2017-06-01 74 views
0

当我单击模块选择对话框内的模块时,DNN刷新页面(悬停前,可拖动元素出现在页面上)。这只发生在我们的皮肤上(https://github.com/2sic/dnn-theme-bootstrap3-instant)。防止页面重新加载模块选择DNN 9

DNN正在寻找使用Teleriks findComponent方法的元素#dnn_ContentPane_SyncPanel(这似乎是一个ajax包装)。由于无法找到元素,DNN执行页面重新加载。

我们的皮肤内容窗格:

<div id="ContentPane" runat="server" containertype="G" containername="Invisible Container" containersrc="default.ascx"></div> 

DNN的代码,触发重载(一个函数调用):

refreshPane: function (paneName, args, callback, callOnReload) { 
    var paneId; 
    if (!paneName) { 
     paneId = this.getModuleManager().getPane().attr('id'); 
    } else { 
     paneId = this.getPaneById(paneName).attr('id'); 
    } 

    var pane = $('#' + paneId); 
    var parentPane = pane.data('parentpane'); 
    if (parentPane) { 
     this.refreshPane(parentPane, args, callback); 
     return; 
    } 
    //set module manager to current refresh pane. 
    this._moduleManager = pane.data('dnnModuleManager'); 
    var ajaxPanel = $find(paneId + "_SyncPanel"); 
    if (ajaxPanel) { 
     //remove action menus from DOM bbefore fresh pane. 
     var handler = this; 
     pane.find('div.DnnModule').each(function() { 
      var moduleId = handler._moduleManager._findModuleId($(this)); 
      $('#moduleActions-' + moduleId).remove(); 
     }); 

     Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._refreshCompleteHandler); 
     this._refreshPaneId = paneId; 
     this._refreshCallback = callback; 
     ajaxPanel.ajaxRequest(args); 
    } else { 
     //save the args into cookie, after page reload then catch the cookie 
     //and float the module for drag 
     if (args && !this._noFloat) { 
      this._setCookie('CEM_CallbackData', args); 
     } 

     if (callOnReload && typeof callback == "function") { 
      callback.call($('#' + paneId), [true]); 
     } 

     location.reload(); 
    } 
} 

回答

0

一段时间后,我们发现了什么问题了。 我们的皮肤使用<%=SkinPath%>语法而不是<%#SkinPath%>,这导致DNN强制重新加载。这可能与文档的生命周期有关。