当前选中的字体提示问题

dev_xiangzheng
lizanle 10 years ago
parent 69bc26033e
commit 4a91c51b33

@ -277,7 +277,7 @@ K.options = {
['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'], ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000'] ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
], ],
fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'], fontSizeTable : ['选中的字体大小:','9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'],
htmlTags : { htmlTags : {
font : ['id', 'class', 'color', 'size', 'face', '.background-color'], font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
span : [ span : [
@ -5737,20 +5737,45 @@ _plugin('core', function(K) {
}); });
}); });
self.clickToolbar('fontsize', function() { self.clickToolbar('fontsize', function() {
// knode = self.getSelectedAnchor();
//console.log(self.cmd.range.startContainer.parentElement.style.fontSize)
var curVal = self.cmd.val('fontsize'), var curVal = self.cmd.val('fontsize'),
menu = self.createMenu({ menu = self.createMenu({
name : 'fontsize', name : 'fontsize',
width : 150 width : 150
}); });
_each(self.fontSizeTable, function(i, val) { _each(self.fontSizeTable, function(i, val) {
if (i==0){
fontsize = "14px"
if(self.cmd.range.startContainer.parentElement.style.fontSize) {
fontsize = self.cmd.range.startContainer.parentElement.style.fontSize
menu.addItem({ menu.addItem({
title : '<span style="font-size:' + val + ';" unselectable="on">' + val + '</span>', title: '<span style="font-size:14px ;" unselectable="on">首个选中字体:' + fontsize + '</span>',
height : _removeUnit(val) + 12, height: 14,
checked : curVal === val, click: function () {
click : function() { }
});
}else {
menu.addItem({
title: '<span style="font-size:14px ;" unselectable="on">当前为默认字体:' + fontsize + '</span>',
height: 14,
click: function () {
}
});
}
}else {
menu.addItem({
title: '<span style="font-size:' + val + ';" unselectable="on">' + val + '</span>',
height: _removeUnit(val) + 12,
checked: curVal === val,
click: function () {
self.exec('fontsize', val).hideMenu(); self.exec('fontsize', val).hideMenu();
} }
}); });
}
}); });
}); });
_each('forecolor,hilitecolor'.split(','), function(i, name) { _each('forecolor,hilitecolor'.split(','), function(i, name) {

Loading…
Cancel
Save