提交 7d042719 编写于 作者: U unknown

修复表单中在样式编辑器的输入形式删除样式无效的问题

上级 5ea4c83f
...@@ -58,7 +58,11 @@ o2.widget.Maplist = new Class({ ...@@ -58,7 +58,11 @@ o2.widget.Maplist = new Class({
"text": this.options.title "text": this.options.title
}).inject(this.titleNode); }).inject(this.titleNode);
this.titleTextNode.addEvent("click", function(){ this.titleTextNode.addEvent("click", function(){
if(this.isShowCode){
}else{
this.expandOrCollapse(); this.expandOrCollapse();
}
}.bind(this)); }.bind(this));
this.createTitleActions(); this.createTitleActions();
...@@ -69,13 +73,16 @@ o2.widget.Maplist = new Class({ ...@@ -69,13 +73,16 @@ o2.widget.Maplist = new Class({
}).inject(this.titleActionNode); }).inject(this.titleActionNode);
this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code_empty.png)"); this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code_empty.png)");
this.actionNode.addEvent("click", function(e){ this.actionNode.addEvent("click", function(e){
if(!this.isShowingCode){
this.showCode(); this.showCode();
}
e.stopPropagation(); e.stopPropagation();
}.bind(this)); }.bind(this));
}, },
showCode: function(){ showCode: function(){
var display = this.contentNode.getStyle("display"); debugger;
if (display=="none") this.expand(); // var display = this.contentNode.getStyle("display");
// if (display=="none") this.expand();
if (!this.isShowCode){ if (!this.isShowCode){
this.codeContentNode = new Element("div", { this.codeContentNode = new Element("div", {
...@@ -86,6 +93,12 @@ o2.widget.Maplist = new Class({ ...@@ -86,6 +93,12 @@ o2.widget.Maplist = new Class({
"events": { "events": {
"blur": function(){ "blur": function(){
this.showCode(); this.showCode();
this.isShowingCode = true;
window.setTimeout( function () {
this.isShowingCode = false;
}.bind(this), 1000 );
this.fireEvent("change"); this.fireEvent("change");
}.bind(this) }.bind(this)
} }
...@@ -106,7 +119,11 @@ o2.widget.Maplist = new Class({ ...@@ -106,7 +119,11 @@ o2.widget.Maplist = new Class({
this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code.png)"); this.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code.png)");
this.isShowCode = true; this.isShowCode = true;
}else{ }else{
this.items = [];
this.contentItemsNode.empty(); this.contentItemsNode.empty();
this.contentNode.setStyle("display", "block");
this.loadContent(JSON.decode(this.codeTextNode.get("value"))); this.loadContent(JSON.decode(this.codeTextNode.get("value")));
this.fireEvent("change"); this.fireEvent("change");
...@@ -121,6 +138,8 @@ o2.widget.Maplist = new Class({ ...@@ -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.actionNode.setStyle("background-image", "url("+this.path+this.options.style+"/icon/code_empty.png)");
this.isShowCode = false; this.isShowCode = false;
} }
}, },
reload: function(json){ reload: function(json){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册