提交 999c2d51 编写于 作者: U unknown

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

上级 f91d0fb0
......@@ -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){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册