解决kindeditor多编辑器的bug

This commit is contained in:
yutao 2015-06-08 14:46:25 +08:00
parent 370bae787f
commit 29edf5ece7
3 changed files with 34 additions and 19 deletions

View File

@ -3909,14 +3909,22 @@ _extend(KToolbar, KWidget, {
}); });
}, },
get : function(name) { get : function(name) {
//if(this._itemMap[name])return this._itemMap[name];
//return this._itemMap[name]=K("span.ke-icon-"+name,this.div).parent()
// if (this._itemMap[name]) { // if (this._itemMap[name]) {
// return this._itemMap[name]; // return this._itemMap[name];
// } // }
if($("#define").css('display') == 'block'){ // if($("#define").css('display') == 'block'){
pdiv = $("#define") // pdiv = $("#define")
}else if($("#full").css('display') == 'block'){ // }else if($("#full").css('display') == 'block'){
pdiv = $("#full") // pdiv = $("#full")
} // }
var container = this.div;
if(!$("#define",container).is(':hidden')){
pdiv = $("#define",container);
}else if(!$("#full",container).is(':hidden')){
pdiv = $("#full",container);
}
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent()); return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
}, },
select : function(name) { select : function(name) {
@ -4865,6 +4873,7 @@ KEditor.prototype = {
}); });
return self; return self;
} }
//if(name=='more')alert(fn);
return self.handler(key, fn); return self.handler(key, fn);
}, },
updateState : function() { updateState : function() {

View File

@ -2,13 +2,16 @@ KindEditor.plugin('less', function(K) {
var self = this, name = 'less'; var self = this, name = 'less';
self.plugin.less = { self.plugin.less = {
click : function(){ click : function(){
if($("#define").css('display') == 'block'){ var container = self.toolbar.div;
$("#define").css('display','none') $("#full",container).hide();
$("#full").css('display','block') $("#define",container).show();
}else if($("#full").css('display') == 'block'){ //if($("#define").css('display') == 'block'){
$("#full").css('display','none') // $("#define").css('display','none')
$("#define").css('display','block') // $("#full").css('display','block')
} //}else if($("#full").css('display') == 'block'){
// $("#full").css('display','none')
// $("#define").css('display','block')
//}
} }
} }
self.clickToolbar(name,self.plugin.less.click) self.clickToolbar(name,self.plugin.less.click)

View File

@ -2,13 +2,16 @@ KindEditor.plugin('more', function(K) {
var self = this, name = 'more'; var self = this, name = 'more';
self.plugin.more = { self.plugin.more = {
click : function(){ click : function(){
if($("#define").css('display') == 'block'){ var container = self.toolbar.div;
$("#define").css('display','none') $("#define",container).hide();
$("#full").css('display','block') $("#full",container).show();
}else if($("#full").css('display') == 'block'){ //if($("#define").css('display') == 'block'){
$("#full").css('display','none') // $("#define").css('display','none')
$("#define").css('display','block') // $("#full").css('display','block')
} //}else if($("#full").css('display') == 'block'){
// $("#full").css('display','none')
// $("#define").css('display','block')
//}
} }
} }
self.clickToolbar(name,self.plugin.more.click) self.clickToolbar(name,self.plugin.more.click)