Procházet zdrojové kódy

修复独立窗口中内容管理发布后未刷新列表页

unknown před 5 roky
rodič
revize
51b9c7650c

+ 18 - 1
o2web/source/x_component_cms_Index/Newer.js

@@ -503,7 +503,24 @@ MWF.xApplication.cms.Index.Newer = new Class({
             };
             };
             if( typeOf(this.options.autoSave) == "boolean" )options.autoSave = this.options.autoSave;
             if( typeOf(this.options.autoSave) == "boolean" )options.autoSave = this.options.autoSave;
             if( typeOf(this.options.saveOnClose) == "boolean" )options.saveOnClose = this.options.saveOnClose;
             if( typeOf(this.options.saveOnClose) == "boolean" )options.saveOnClose = this.options.saveOnClose;
-            this.app.desktop.openApplication(el, "cms.Document", options);
+            if( layout.inBrowser ){
+                debugger;
+                if( !window.o2RefreshCMSView ){
+                    window.o2CreateCMSDocumentCount = ( window.o2CreateCMSDocumentCount || 0 ) + 1;
+                    window.o2RefreshCMSView = function () {
+                        try{
+                            if(_self.view && _self.view.reload )_self.view.reload();
+                        }catch (e) {}
+                        if( window.o2CreateCMSDocumentCount )window.o2CreateCMSDocumentCount--;
+                        if( !window.o2CreateCMSDocumentCount || window.o2CreateCMSDocumentCount<0 ){
+                            window.o2RefreshCMSView = null;
+                        }
+                    }.bind(this)
+                }
+                this.app.desktop.openApplication(el, "cms.Document", options);
+            }else{
+                this.app.desktop.openApplication(el, "cms.Document", options);
+            }
         }
         }
     },
     },
     _createProcessDocument:function(e){
     _createProcessDocument:function(e){

+ 6 - 0
o2web/source/x_component_cms_Xform/Form.js

@@ -479,7 +479,13 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class({
                 }
                 }
                 this.options.saveOnClose = false;
                 this.options.saveOnClose = false;
             }
             }
+            debugger;
             if( layout.inBrowser ){
             if( layout.inBrowser ){
+                try{
+                    if( window.opener && window.opener.o2RefreshCMSView ){
+                        window.opener.o2RefreshCMSView();
+                    }
+                }catch (e) {}
                 window.setTimeout(function () {
                 window.setTimeout(function () {
                     this.app.close();
                     this.app.close();
                 }.bind(this), 1500)
                 }.bind(this), 1500)