글꼴 크기 커스터마이징 완료
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
.trumbowyg-fontsize_24pt-dropdown-button{
|
||||
min-height:25pt;
|
||||
.trumbowyg-fontsize_24px-dropdown-button{
|
||||
min-height:25px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_28pt-dropdown-button{
|
||||
min-height:29pt;
|
||||
.trumbowyg-fontsize_28px-dropdown-button{
|
||||
min-height:29px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_32pt-dropdown-button{
|
||||
min-height:33pt;
|
||||
.trumbowyg-fontsize_32px-dropdown-button{
|
||||
min-height:33px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_40pt-dropdown-button{
|
||||
min-height:41pt;
|
||||
.trumbowyg-fontsize_40px-dropdown-button{
|
||||
min-height:41px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_46pt-dropdown-button{
|
||||
min-height:47pt;
|
||||
.trumbowyg-fontsize_46px-dropdown-button{
|
||||
min-height:47px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_52pt-dropdown-button{
|
||||
min-height:53pt;
|
||||
.trumbowyg-fontsize_52px-dropdown-button{
|
||||
min-height:53px;
|
||||
}
|
||||
|
||||
.trumbowyg-fontsize_60pt-dropdown-button{
|
||||
min-height:61pt;
|
||||
.trumbowyg-fontsize_60px-dropdown-button{
|
||||
min-height:61px;
|
||||
}
|
||||
@@ -7,11 +7,6 @@
|
||||
en: {
|
||||
fontsize: 'Font size',
|
||||
fontsizes: {
|
||||
'x-small': 'Extra small',
|
||||
'small': 'Small',
|
||||
'medium': 'Regular',
|
||||
'large': 'Large',
|
||||
'x-large': 'Extra large',
|
||||
'custom': 'Custom'
|
||||
}
|
||||
},
|
||||
@@ -41,30 +36,41 @@
|
||||
function buildDropdown(trumbowyg) {
|
||||
var dropdown = [];
|
||||
var sizes = [
|
||||
'8pt',
|
||||
'9pt',
|
||||
'10pt',
|
||||
'11pt',
|
||||
'12pt',
|
||||
'14pt',
|
||||
'16pt',
|
||||
'18pt',
|
||||
'20pt',
|
||||
'24pt',
|
||||
'28pt',
|
||||
'32pt',
|
||||
'40pt',
|
||||
'46pt',
|
||||
'52pt',
|
||||
'60pt'
|
||||
'8px',
|
||||
'9px',
|
||||
'10px',
|
||||
'11px',
|
||||
'12px',
|
||||
'14px',
|
||||
'16px',
|
||||
'18px',
|
||||
'20px',
|
||||
'24px',
|
||||
'28px',
|
||||
'32px',
|
||||
'40px',
|
||||
'46px',
|
||||
'52px',
|
||||
'60px'
|
||||
];
|
||||
|
||||
$.each(sizes, function (index, size) {
|
||||
trumbowyg.addBtnDef('fontsize_' + size, {
|
||||
text: '<span style="font-size: ' + size + ';line-height: ' + size + '">' + size + '</span>',
|
||||
text: '<span style="font-size: ' + size + ';">' + size + '</span>',
|
||||
hasIcon: false,
|
||||
fn: function () {
|
||||
trumbowyg.execCmd('fontSize', index + 1, true);
|
||||
trumbowyg.saveRange();
|
||||
var text = trumbowyg.range.startContainer.parentElement;
|
||||
var selectedText = trumbowyg.getRangeText();
|
||||
if ($(text).html() === selectedText) {
|
||||
$(text).css('font-size', size);
|
||||
} else {
|
||||
trumbowyg.range.deleteContents();
|
||||
var html = '<span style="font-size: ' + size + ';">' + selectedText + '</span>';
|
||||
var node = $(html)[0];
|
||||
trumbowyg.range.insertNode(node);
|
||||
}
|
||||
trumbowyg.saveRange();
|
||||
}
|
||||
});
|
||||
dropdown.push('fontsize_' + size);
|
||||
|
||||
Reference in New Issue
Block a user