8
0
Просмотр исходного кода

Import SVG files straight to JS.

Piotrek Koszuliński 9 лет назад
Родитель
Сommit
37c455872a
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      packages/ckeditor5-undo/src/undo.js

+ 8 - 4
packages/ckeditor5-undo/src/undo.js

@@ -11,6 +11,9 @@ import Plugin from 'ckeditor5-core/src/plugin';
 import UndoEngine from './undoengine';
 import UndoEngine from './undoengine';
 import ButtonView from 'ckeditor5-ui/src/button/buttonview';
 import ButtonView from 'ckeditor5-ui/src/button/buttonview';
 
 
+import undoIcon from '../theme/icons/undo.svg';
+import redoIcon from '../theme/icons/redo.svg';
+
 /**
 /**
  * The undo feature. It introduces the Undo and Redo buttons to the editor.
  * The undo feature. It introduces the Undo and Redo buttons to the editor.
  *
  *
@@ -139,8 +142,8 @@ export default class Undo extends Plugin {
 		const editor = this.editor;
 		const editor = this.editor;
 		const t = editor.t;
 		const t = editor.t;
 
 
-		this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z' );
-		this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y' );
+		this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z', undoIcon );
+		this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y', redoIcon );
 
 
 		editor.keystrokes.set( 'CTRL+Z', 'undo' );
 		editor.keystrokes.set( 'CTRL+Z', 'undo' );
 		editor.keystrokes.set( 'CTRL+Y', 'redo' );
 		editor.keystrokes.set( 'CTRL+Y', 'redo' );
@@ -154,8 +157,9 @@ export default class Undo extends Plugin {
 	 * @param {String} name Command name.
 	 * @param {String} name Command name.
 	 * @param {String} label Button label.
 	 * @param {String} label Button label.
 	 * @param {String} keystroke Command keystroke.
 	 * @param {String} keystroke Command keystroke.
+	 * @param {String} Icon Source of the icon.
 	 */
 	 */
-	_addButton( name, label, keystroke ) {
+	_addButton( name, label, keystroke, Icon ) {
 		const editor = this.editor;
 		const editor = this.editor;
 		const command = editor.commands.get( name );
 		const command = editor.commands.get( name );
 
 
@@ -164,7 +168,7 @@ export default class Undo extends Plugin {
 
 
 			view.set( {
 			view.set( {
 				label: label,
 				label: label,
-				icon: name,
+				icon: Icon,
 				keystroke
 				keystroke
 			} );
 			} );