From 4a91c51b3371c84ae6650ef9de4a5d059190672c Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 26 Oct 2015 17:15:13 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=80=89=E4=B8=AD=E7=9A=84?=
=?UTF-8?q?=E5=AD=97=E4=BD=93=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/kindeditor/kindeditor.js | 43 ++++++++++++++++++++------
1 file changed, 34 insertions(+), 9 deletions(-)
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 5f1063f0b..aadb295f4 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -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 : '' + val + '',
- 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: '首个选中字体:' + fontsize + '',
+ height: 14,
+ click: function () {
+ }
+ });
+ }else {
+ menu.addItem({
+ title: '当前为默认字体:' + fontsize + '',
+ height: 14,
+ click: function () {
+ }
+ });
+ }
+ }else {
+ menu.addItem({
+ title: '' + val + '',
+ height: _removeUnit(val) + 12,
+ checked: curVal === val,
+ click: function () {
+ self.exec('fontsize', val).hideMenu();
+
+ }
+ });
+ }
+
});
});
_each('forecolor,hilitecolor'.split(','), function(i, name) {