还原行距问题

luoquan
luoquan 10 years ago
parent a6da304b56
commit 2d14b26c11

@ -1,38 +1,40 @@
/******************************************************************************* /*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet * KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net * Copyright (C) 2006-2011 kindsoft.net
* *
* @author Roddy <luolonghao@gmail.com> * @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/ * @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php * @licence http://www.kindsoft.net/license.php
*******************************************************************************/ *******************************************************************************/
KindEditor.plugin('lineheight', function(K) { KindEditor.plugin('lineheight', function(K) {
var self = this, name = 'lineheight', lang = self.lang(name + '.'); var self = this, name = 'lineheight', lang = self.lang(name + '.');
self.clickToolbar(name, function() { self.clickToolbar(name, function() {
var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'}); var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'});
if (commonNode) { if (commonNode) {
curVal = commonNode.css('line-height'); curVal = commonNode.css('line-height');
} }
var menu = self.createMenu({ var menu = self.createMenu({
name : name, name : name,
width : 150 width : 150
}); });
K.each(lang.lineHeight, function(i, row) { K.each(lang.lineHeight, function(i, row) {
K.each(row, function(key, val) { K.each(row, function(key, val) {
menu.addItem({ menu.addItem({
title : val, title : val,
checked : curVal === key, checked : curVal === key,
click : function() { click : function() {
self.cmd.toggle('<span style="line-height:' + key + ';"></span>', { self.cmd.toggle('<span style="line-height:' + key + ';"></span>', {
span : '.line-height=' + key span : '.line-height=' + key
}); });
self.updateState(); self.updateState();
self.addBookmark(); self.addBookmark();
self.hideMenu(); //curVal = key;
} //self.cmd.doc.body.style.lineHeight = key;
}); self.hideMenu();
}); }
}); });
}); });
}); });
});
});

Loading…
Cancel
Save