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

Code refactoring: re–formatted the keystrokes to match the general code–style rules.

Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
71d206e5af
2 измененных файлов с 5 добавлено и 3 удалено
  1. 4 2
      packages/ckeditor5-link/src/link.js
  2. 1 1
      packages/ckeditor5-link/tests/link.js

+ 4 - 2
packages/ckeditor5-link/src/link.js

@@ -24,6 +24,8 @@ import unlinkIcon from '../theme/icons/unlink.svg';
 
 import '../theme/theme.scss';
 
+const linkKeystroke = 'Ctrl+K';
+
 /**
  * The link plugin. It introduces the Link and Unlink buttons and the <kbd>Ctrl+K</kbd> keystroke.
  *
@@ -124,7 +126,7 @@ export default class Link extends Plugin {
 		const t = editor.t;
 
 		// Handle `Ctrl+K` keystroke and show the panel.
-		editor.keystrokes.set( 'CTRL+K', () => {
+		editor.keystrokes.set( linkKeystroke, () => {
 			if ( linkCommand.isEnabled ) {
 				this._showPanel( true );
 			}
@@ -136,7 +138,7 @@ export default class Link extends Plugin {
 			button.isEnabled = true;
 			button.label = t( 'Link' );
 			button.icon = linkIcon;
-			button.keystroke = 'CTRL+K';
+			button.keystroke = linkKeystroke;
 			button.tooltip = true;
 
 			// Bind button to the command.

+ 1 - 1
packages/ckeditor5-link/tests/link.js

@@ -437,7 +437,7 @@ describe( 'Link', () => {
 	} );
 
 	describe( 'keyboard support', () => {
-		it( 'should show the #_balloon with selected #formView on `CTRL+K` keystroke', () => {
+		it( 'should show the #_balloon with selected #formView on Ctrl+K keystroke', () => {
 			const spy = testUtils.sinon.stub( linkFeature, '_showPanel', () => {} );
 			const command = editor.commands.get( 'link' );