8
0
Kamil Piechaczek 6 лет назад
Родитель
Сommit
79021df5c5

+ 1 - 1
packages/ckeditor5-horizontal-line/src/horizontalruleui.js

@@ -31,7 +31,7 @@ export default class HorizontalRuleUI extends Plugin {
 				isToggleable: true
 			} );
 
-			view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
+			view.bind( 'isEnabled' ).to( command, 'isEnabled' );
 
 			// Execute command.
 			this.listenTo( view, 'execute', () => editor.execute( 'horizontalRule' ) );

+ 2 - 12
packages/ckeditor5-horizontal-line/src/utils.js

@@ -7,7 +7,7 @@
  * @module horizontal-rule/utils
  */
 
-import { findOptimalInsertionPosition, isWidget, toWidget } from '@ckeditor/ckeditor5-widget/src/utils';
+import { findOptimalInsertionPosition, toWidget } from '@ckeditor/ckeditor5-widget/src/utils';
 
 /**
  * @param {module:engine/view/element~Element} viewElement
@@ -18,17 +18,7 @@ import { findOptimalInsertionPosition, isWidget, toWidget } from '@ckeditor/cked
 export function toHorizontalRuleWidget( viewElement, writer, label ) {
 	writer.setCustomProperty( 'horizontalRule', true, viewElement );
 
-	return toWidget( viewElement, writer, { label, hasSelectionHandler: true } );
-}
-
-/**
- * Checks if a given view element is a horizontal rule widget.
- *
- * @param {module:engine/view/element~Element} viewElement
- * @returns {Boolean}
- */
-export function isHorizontalRuleWidget( viewElement ) {
-	return !!viewElement.getCustomProperty( 'horizontalRule' ) && isWidget( viewElement );
+	return toWidget( viewElement, writer, { label } );
 }
 
 /**