0

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

DNN 正在使用 Teleriks方法寻找元素#dnn_ContentPane_SyncPanel(这似乎是一个 ajax 包装器) 。findComponent因为找不到元素,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();
    }
}
4

1 回答 1

0

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

于 2017-06-01T12:04:42.933 回答