Преглед изворни кода

Changed priorites for events.

Kamil Piechaczek пре 5 година
родитељ
комит
b2a0a5f2c9

+ 5 - 5
packages/ckeditor5-table/src/tablemouse.js

@@ -85,11 +85,11 @@ export default class TableMouse extends Plugin {
 
 				domEventData.preventDefault();
 			}
-		} );
+		}, { priority: 'low' } );
 
 		this.listenTo( editor.editing.view.document, 'mouseup', () => {
 			blockSelectionChange = false;
-		} );
+		}, { priority: 'low' } );
 
 		// We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
 		// When downcasting table cells selection to the view, we put the view selection in the last selected cell
@@ -145,7 +145,7 @@ export default class TableMouse extends Plugin {
 			}
 
 			anchorCell = this._getModelTableCellFromDomEvent( domEventData );
-		} );
+		}, { priority: 'low' } );
 
 		this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
 			if ( !domEventData.domEvent.buttons ) {
@@ -177,14 +177,14 @@ export default class TableMouse extends Plugin {
 			tableSelection.setCellSelection( anchorCell, targetCell );
 
 			domEventData.preventDefault();
-		} );
+		}, { priority: 'low' } );
 
 		this.listenTo( editor.editing.view.document, 'mouseup', () => {
 			beganCellSelection = false;
 			blockSelectionChange = false;
 			anchorCell = null;
 			targetCell = null;
-		} );
+		}, { priority: 'low' } );
 
 		// See the explanation in `_enableShiftClickSelection()`.
 		this.listenTo( editor.editing.view.document, 'selectionChange', evt => {

+ 1 - 1
packages/ckeditor5-widget/src/widgetresize.js

@@ -76,7 +76,7 @@ export default class WidgetResize extends Plugin {
 
 		this._observer = Object.create( DomEmitterMixin );
 
-		this.listenTo( this.editor.editing.view.document, 'mousedown', this._mouseDownListener.bind( this ), { priority: 'high' } );
+		this.listenTo( this.editor.editing.view.document, 'mousedown', this._mouseDownListener.bind( this ) );
 
 		this._observer.listenTo( domDocument, 'mousemove', this._mouseMoveListener.bind( this ) );
 		this._observer.listenTo( domDocument, 'mouseup', this._mouseUpListener.bind( this ) );

+ 3 - 2
packages/ckeditor5-widget/tests/widgetresize-integration.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
-/* global document */
+/* global document, Event */
 
 import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
 
@@ -47,7 +47,8 @@ describe( 'WidgetResize - integration', () => {
 		const squareDomElement = view.domConverter.mapViewToDom( resizeSquareUI ).querySelector( '.ck-widget__resizer__handle-top-left' );
 
 		viewDocument.on( 'mousedown', eventSpy );
-		viewDocument.fire( 'mousedown', { domTarget: squareDomElement } );
+
+		squareDomElement.dispatchEvent( new Event( 'mousedown' ) );
 
 		expect( eventSpy.called ).to.equal( false );
 	} );