CKEditor: add properties in buttonDefinition (#13636)

* CKEditor add icon in buttonDefinition

Add icon and iconOffset optional properties in buttonDefinition
interface

* Test

Add test

* Confirm to style
This commit is contained in:
denisname
2017-01-05 11:57:15 -08:00
committed by Andy
parent 93357460d2
commit 694b16f5b0
2 changed files with 28 additions and 0 deletions
+26
View File
@@ -270,6 +270,32 @@ function test_dom_window() {
alert(size.height);
}
function test_adding_command_and_buttons() {
var textarea = document.createElement('textarea');
var instance = CKEDITOR.replace(textarea);
instance.addCommand( 'aCommand', {
exec: function( editor: CKEDITOR.editor ) {
// empty logic
return true;
}
});
instance.ui.addButton( 'firstButton', {
icon: 'http://www.example.com/assets/images/icons.png',
iconOffset: -32,
label: 'Label 1',
command: 'aCommand',
toolbar: 'tools'
});
instance.ui.addButton( 'secondButton', {
label: 'Label 2',
command: 'aCommand',
toolbar: 'tools'
});
}
function test_adding_dialog_by_path() {
CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' );
}
+2
View File
@@ -1255,6 +1255,8 @@ declare namespace CKEDITOR {
}
interface buttonDefinition {
icon?: string;
iconOffset?: number;
label : string;
command : string;
toolbar : string;