瀏覽代碼

Prevent from redrawing the resize handles when plugin is disabled.

panr 5 年之前
父節點
當前提交
24532ceef3
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      packages/ckeditor5-widget/src/widgetresize/resizer.js

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

@@ -95,6 +95,14 @@ export default class Resizer {
 				event.stop();
 			}
 		}, { priority: 'high' } );
+
+		this.on( 'change:isEnabled', () => {
+			// We should redraw the resize handles when the plugin is enabled again.
+			// Otherwise they won't show up.
+			if ( this.isEnabled ) {
+				this.redraw();
+			}
+		} );
 	}
 
 	/**
@@ -226,6 +234,10 @@ 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;
 
 		if ( existsInDom( domWrapper ) ) {