Przeglądaj źródła

Get rid of the redundant fixes for Resizer.

panr 5 lat temu
rodzic
commit
5a702bd27f

+ 0 - 10
packages/ckeditor5-widget/src/widgetresize.js

@@ -106,16 +106,6 @@ export default class WidgetResize extends Plugin {
 
 			this._visibleResizer = this._getResizerByViewElement( selectedElement ) || null;
 		} );
-
-		// Currently, we have set the `redrawFocusedResizerThrottled()` callback on every editor's `update`,
-		// which doesn't stop executing when we click outside the editor.
-		// We should reset the `#_visibleResizer` to stop redrawing the ResizeWidget's handles when they are not in use.
-		// ATM, constantly redrawing widget is hard to be set disabled.
-		this.editor.ui.view.editable.on( 'change:isFocused', () => {
-			if ( !this.editor.ui.view.editable.isFocused ) {
-				this._visibleResizer = null;
-			}
-		} );
 	}
 
 	/**

+ 0 - 4
packages/ckeditor5-widget/src/widgetresize/resizer.js

@@ -235,10 +235,6 @@ export default class Resizer {
 	 * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
 	 */
 	redraw( handleHostRect ) {
-		if ( !this.isEnabled ) {
-			return;
-		}
-
 		const domWrapper = this._domResizerWrapper;
 
 		// Refresh only if resizer exists in the DOM.

+ 0 - 9
packages/ckeditor5-widget/tests/widgetresize.js

@@ -519,15 +519,6 @@ describe( 'WidgetResize', () => {
 
 			expect( redrawSpy.callCount ).to.equal( 1 );
 		} );
-
-		it( 'should set "#_visibleResizer" to "null" when editor is not focused', () => {
-			const plugin = editor.plugins.get( 'WidgetResize' );
-			plugin._visibleResizer = createResizer();
-
-			editor.ui.view.editable.isFocused = false;
-
-			expect( plugin._visibleResizer ).to.be.null;
-		} );
 	} );
 
 	describe( 'cancel()', () => {