当前选中的字体提示问题
This commit is contained in:
parent
69bc26033e
commit
4a91c51b33
|
@ -277,7 +277,7 @@ K.options = {
|
|||
['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
|
||||
['#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 : {
|
||||
font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
|
||||
span : [
|
||||
|
@ -5737,20 +5737,45 @@ _plugin('core', function(K) {
|
|||
});
|
||||
});
|
||||
self.clickToolbar('fontsize', function() {
|
||||
// knode = self.getSelectedAnchor();
|
||||
|
||||
//console.log(self.cmd.range.startContainer.parentElement.style.fontSize)
|
||||
var curVal = self.cmd.val('fontsize'),
|
||||
menu = self.createMenu({
|
||||
name : 'fontsize',
|
||||
width : 150
|
||||
});
|
||||
_each(self.fontSizeTable, function(i, val) {
|
||||
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();
|
||||
}
|
||||
});
|
||||
if (i==0){
|
||||
fontsize = "14px"
|
||||
if(self.cmd.range.startContainer.parentElement.style.fontSize) {
|
||||
fontsize = self.cmd.range.startContainer.parentElement.style.fontSize
|
||||
menu.addItem({
|
||||
title: '<span style="font-size:14px ;" unselectable="on">首个选中字体:' + fontsize + '</span>',
|
||||
height: 14,
|
||||
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();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
_each('forecolor,hilitecolor'.split(','), function(i, name) {
|
||||
|
|
Loading…
Reference in New Issue