Просмотр исходного кода

修复内容管理文档发布以后,栏目列表界面不刷新的问题

unknown 5 лет назад
Родитель
Сommit
5ddf1644d3

+ 1 - 0
o2web/source/x_component_cms_Document/Main.js

@@ -366,6 +366,7 @@ MWF.xApplication.cms.Document.Main = new Class({
                     "autoSave" : this.options.autoSave,
                     "saveOnClose" : this.options.saveOnClose,
                     "onPostPublish" : this.options.postPublish,
+                    "onAfterPublish" : this.options.afterPublish,
                     "onPostDelete" : this.options.postDelete
                 });
                 this.appForm.businessData = {

+ 5 - 2
o2web/source/x_component_cms_Index/Newer.js

@@ -492,10 +492,13 @@ MWF.xApplication.cms.Index.Newer = new Class({
                 "documentId": id,
                 "appId": appId,
                 "onPostPublish" : function(){
+                    this.fireEvent( "postPublish" );
+                }.bind(this),
+                "onAfterPublish" : function () {
                     debugger;
                     if(_self.view && _self.view.reload )_self.view.reload();
-                    this.fireEvent( "postPublish" );
-                }.bind(this)
+                    _self.fireEvent( "afterPublish" );
+                }
             };
             if( typeOf(this.options.autoSave) == "boolean" )options.autoSave = this.options.autoSave;
             if( typeOf(this.options.saveOnClose) == "boolean" )options.saveOnClose = this.options.saveOnClose;

+ 9 - 10
o2web/source/x_component_cms_Module/Main.js

@@ -226,16 +226,15 @@ MWF.xApplication.cms.Module.Main = new Class({
 						//if(this.options.columnData.ignoreTitle===undefined) this.options.columnData.ignoreTitle = false;
 
 						this.creater = new MWF.xApplication.cms.Index.Newer( this.options.columnData, null, this, this.view, {
-							restrictToColumn : true,
-							onPostPublish : function () {
-								debugger;
-								try{
-									if(this.view && this.view.reload){
-										this.view.reload();
-									}
-								}catch (e) {
-								}
-							}.bind(this)
+							restrictToColumn : true
+							// onAfterPublish : function () {
+							// 	try{
+							// 		if(this.view && this.view.reload){
+							// 			this.view.reload();
+							// 		}
+							// 	}catch (e) {
+							// 	}
+							// }.bind(this)
 							//ignoreTitle : this.options.columnData.ignoreTitle,
 							//latest : this.options.columnData.latest
 						});

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

@@ -457,6 +457,7 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class({
         delete documentData.attachmentList;
         //this.documentAction.saveDocument(documentData, function(){
         this.fireEvent("postPublish", [documentData]);
+        if (this.app) if (this.app.fireEvent) this.app.fireEvent("postPublish",[documentData]);
         if (this.officeList) {
             this.officeList.each(function (module) {
                 module.save(history);
@@ -465,6 +466,7 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class({
         this.documentAction.publishDocumentComplex(documentData, function (json) {
             this.businessData.data.isNew = false;
             this.fireEvent("afterPublish");
+            if (this.app) if (this.app.fireEvent) this.app.fireEvent("afterPublish");
             if (callback) callback();
             if (this.app.mobile) {
                 this.app.content.unmask();