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

Merge branch 'fix/Process._maplist_execption' into 'develop'

Merge of fix/[内容管理]修复表单的样式编辑器在输入形式删除无效的问题 to develop

See merge request o2oa/o2oa!1231
蔡祥熠 5 лет назад
Родитель
Сommit
fc6fffc2ee
1 измененных файлов с 23 добавлено и 4 удалено
  1. 23 4
      o2web/source/o2_core/o2/widget/Maplist.js

+ 23 - 4
o2web/source/o2_core/o2/widget/Maplist.js

@@ -58,7 +58,11 @@ o2.widget.Maplist = new Class({
 			"text": this.options.title
 		}).inject(this.titleNode);
 		this.titleTextNode.addEvent("click", function(){
-			this.expandOrCollapse();
+			if(this.isShowCode){
+
+			}else{
+				this.expandOrCollapse();
+			}
 		}.bind(this));
 
 		this.createTitleActions();
@@ -69,13 +73,16 @@ o2.widget.Maplist = new Class({
 		}).inject(this.titleActionNode);
 		this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code_empty.png)");
 		this.actionNode.addEvent("click", function(e){
-            this.showCode();
+			if(!this.isShowingCode){
+				this.showCode();
+			}
             e.stopPropagation();
         }.bind(this));
 	},
 	showCode: function(){
-		var display = this.contentNode.getStyle("display");
-		if (display=="none") this.expand();
+		debugger;
+		// var display = this.contentNode.getStyle("display");
+		// if (display=="none") this.expand();
 			
 		if (!this.isShowCode){
 			this.codeContentNode = new Element("div", {
@@ -86,6 +93,12 @@ o2.widget.Maplist = new Class({
 				"events": {
 					"blur": function(){
 						this.showCode();
+
+						this.isShowingCode = true;
+						window.setTimeout( function () {
+							this.isShowingCode = false;
+						}.bind(this), 1000 );
+
 						this.fireEvent("change");
 					}.bind(this)
 				}
@@ -106,7 +119,11 @@ o2.widget.Maplist = new Class({
 			this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code.png)");
 			this.isShowCode = true;
 		}else{
+			this.items = [];
 			this.contentItemsNode.empty();
+
+			this.contentNode.setStyle("display", "block");
+
 			this.loadContent(JSON.decode(this.codeTextNode.get("value")));
 			this.fireEvent("change");
 			
@@ -121,6 +138,8 @@ o2.widget.Maplist = new Class({
 			});
 			this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code_empty.png)");
 			this.isShowCode = false;
+
+
 		}
 	},
     reload: function(json){