web/static/ldt/js/projectscontents.js
branchmodal_update
changeset 38 457d4ab675df
parent 37 3586af4092f3
child 46 ba02faf089df
equal deleted inserted replaced
37:3586af4092f3 38:457d4ab675df
   192         $(this).attr("target","_iri");
   192         $(this).attr("target","_iri");
   193     });
   193     });
   194     $('.ldt_link',base_node).nyroModal({
   194     $('.ldt_link',base_node).nyroModal({
   195         filters: ['iriIframe'],
   195         filters: ['iriIframe'],
   196         sizes: {
   196         sizes: {
   197             minW: '1022',
   197             minW: '1025',
   198             minH: '662'
   198             minH: '665'
   199         },
   199         },
   200         showCloseButton: true,
   200         showCloseButton: true,
   201         closeOnEscape:false,
   201         closeOnEscape:false,
   202         closeOnClick:false,
   202         closeOnClick:false,
   203         callbacks: {
   203         callbacks: {
   204             afterShowCont: function(nm) {
   204             afterShowCont: function(nm) {
   205                 nm.store.iframe.height(662);
   205                 nm.store.iframe.width(1025);
   206                 nm.store.iframe.width(1022);
   206                 nm.store.iframe.height(665);
   207             },
   207             },
   208             close: function(nm) {
   208             close: function(nm) {
   209                 // We don't do anything here, we hack the callback directly from the close function.
   209                 // We don't do anything here, we hack the callback directly from the close function.
   210             },
   210             },
   211             afterClose: function(nm) {
   211             afterClose: function(nm) {
   212                 // Can't do that because searchprojectfilterurl is not defined in init_events_base params
   212                 // Can't do that because searchprojectfilterurl is not defined in init_events_base params
   213                 searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
   213                 searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
   214             }
   214             }
   215         },
       
   216         resize: function(recalc) {
       
   217             // We need to hack resize AND _unreposition to avoid reload in the modal when we resize the browser.
       
   218             // This code is from the resize function in nmObj.resize
       
   219             this.sizes.w = this.sizes.initW;
       
   220             this.sizes.h = this.sizes.initH;
       
   221             this.size();
       
   222             // callAnim('resize') generates the nodal reload, and we don't want that.
       
   223             // this._callAnim('resize', $.proxy(function() {
       
   224                 // this._reposition();
       
   225             // }, this));
       
   226             // This code is from the resize function in _animations.basic
       
   227             this.elts.cont.css({
       
   228                 width: this.sizes.w,
       
   229                 height: this.sizes.h,
       
   230                 top: (this.getInternal().fullSize.viewH - this.sizes.h - this.sizes.hMargin)/2,
       
   231                 left: (this.getInternal().fullSize.viewW - this.sizes.w - this.sizes.wMargin)/2
       
   232             });
       
   233         },
       
   234         _unreposition: function() {
       
   235             // We need to hack resize AND _unreposition to avoid reload in the modal when we resize the browser.
       
   236         }
   215         }
   237     });
   216     });
   238 
   217 
   239 
   218 
   240     $('.ldt_link',base_node).each(function(i, e) {
   219     $('.ldt_link',base_node).each(function(i, e) {
   268                     if(form_status === 'saved' || form_status === 'deleted' ) {
   247                     if(form_status === 'saved' || form_status === 'deleted' ) {
   269                         $.nmTop().close();
   248                         $.nmTop().close();
   270                     }
   249                     }
   271                     var swfobject = $(this).contents().find("#ldtInitSwf"); 
   250                     var swfobject = $(this).contents().find("#ldtInitSwf"); 
   272                     if (swfobject.length) {
   251                     if (swfobject.length) {
   273                         nm['sizes']['initW'] = swfobject.width() + 21;
   252                         nm['sizes']['initW'] = 1025;
   274                         nm['sizes']['initH'] = swfobject.height() + 31;
   253                         nm['sizes']['initH'] = 665;
   275                         nm.resize();
   254                         nm.resize();
   276                         nm.store.iframe.height(swfobject.height() + 31);
   255                         nm.store.iframe.width(1025);
   277                         nm.store.iframe.width(swfobject.width() + 21);
   256                         nm.store.iframe.height(665);
   278                     }
   257                     }
   279                 });
   258                 });
   280             },
   259             },
   281             afterClose: function(nm) {
   260             afterClose: function(nm) {
   282                 searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);
   261                 searchCallback($('#searchprojectsinput'), "#projectslistcontainer", searchprojectfilterurl, 0);