From 4589ee4d3f4fce7f530e517005457947f8fbd93a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 May 2020 13:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=85=E5=AE=B9=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=A1=A8=E5=8D=95=E6=93=8D=E4=BD=9C=E6=9D=A1=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E8=AE=BE=E7=BD=AE=E6=A0=B7=E5=BC=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Module/Actionbar.js | 47 +++++++++++++++++-- .../source/x_component_cms_Xform/Actionbar.js | 1 + 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar.js b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar.js index c41e1cf0f9..b20edc9f1e 100644 --- a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar.js +++ b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar.js @@ -36,7 +36,8 @@ MWF.xApplication.cms.FormDesigner.Module.Actionbar = MWF.CMSFCActionbar = new Cl this.json.customIconOverStyle = "white"; }, setAllStyles: function(){ - this._refreshActionbar(); + //this._refreshActionbar(); + this._resetActionbar(); }, _createNode: function(callback){ this.node = new Element("div", { @@ -86,8 +87,8 @@ MWF.xApplication.cms.FormDesigner.Module.Actionbar = MWF.CMSFCActionbar = new Cl this.toolbarNode = this.node.getFirst("div"); this.toolbarNode.empty(); this.toolbarWidget = new MWF.widget.SimpleToolbar(this.toolbarNode, {"style": this.json.style}, this); - //if (!this.json.actionStyles) this.json.actionStyles = Object.clone(this.toolbarWidget.css); - //this.toolbarWidget.css = this.json.actionStyles; + if (!this.json.actionStyles) this.json.actionStyles = Object.clone(this.toolbarWidget.css); + this.toolbarWidget.css = this.json.actionStyles; if (this.json.defaultTools){ var json = Array.clone(this.json.defaultTools); @@ -146,6 +147,46 @@ MWF.xApplication.cms.FormDesigner.Module.Actionbar = MWF.CMSFCActionbar = new Cl // } // //}, + _resetActionbar: function(){ + if (this.form.options.mode == "Mobile"){ + this.node.set("text", MWF.APPFD.LP.notice.notUseModuleInMobile+"("+this.moduleName+")"); + this.node.setStyles({"height": "24px", "line-height": "24px", "background-color": "#999"}); + }else{ + this.toolbarNode = this.node.getFirst("div"); + this.toolbarNode.empty(); + this.toolbarWidget = new MWF.widget.SimpleToolbar(this.toolbarNode, {"style": this.json.style}, this); + // this.toolbarWidget = new MWF.widget.Toolbar(this.toolbarNode, {"style": this.json.style}, this); + if (!this.json.actionStyles){ + this.json.actionStyles = Object.clone(this.toolbarWidget.css); + }else{ + this.toolbarWidget.css = Object.merge( Object.clone(this.json.actionStyles), this.toolbarWidget.css ); + this.json.actionStyles = Object.clone(this.toolbarWidget.css); + } + + if (this.json.defaultTools){ + var json = Array.clone(this.json.defaultTools); + //if (this.json.tools) json.append(this.json.tools); + this.setToolbars(json, this.toolbarNode); + if (this.json.tools){ + this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode); + } + this.toolbarWidget.load(); + //json = null; + }else{ + MWF.getJSON(this.path+"toolbars.json", function(json){ + this.json.defaultTools = json; + var json = Array.clone(this.json.defaultTools); + //if (this.json.tools) json.append(this.json.tools); + this.setToolbars(json, this.toolbarNode); + if (this.json.tools){ + this.setCustomToolbars(Array.clone(this.json.tools), this.toolbarNode); + } + this.toolbarWidget.load(); + //json = null; + }.bind(this), false); + } + } + }, setToolbars: function(tools, node){ tools.each(function(tool){ var actionNode = new Element("div", { diff --git a/o2web/source/x_component_cms_Xform/Actionbar.js b/o2web/source/x_component_cms_Xform/Actionbar.js index cd915ac334..9cd1e5cb3c 100644 --- a/o2web/source/x_component_cms_Xform/Actionbar.js +++ b/o2web/source/x_component_cms_Xform/Actionbar.js @@ -21,6 +21,7 @@ MWF.xApplication.cms.Xform.Actionbar = MWF.CMSActionbar = new Class({ this.fireEvent("afterLoad"); }.bind(this) }, this); + if (this.json.actionStyles) this.toolbarWidget.css = this.json.actionStyles; //var json = this.readonly ? this.json.sysTools.readTools : this.json.sysTools.editTools; //if( this.json.style == "xform_red_simple" ){ -- GitLab