瀏覽代碼

Improved docs.

Oskar Wróbel 9 年之前
父節點
當前提交
a1b1b05548

+ 1 - 1
packages/ckeditor5-engine/src/view/observer/fakeselectionobserver.js

@@ -31,7 +31,7 @@ export default class FakeSelectionObserver extends Observer {
 		super( document );
 
 		/**
-		 * Fires `selectionChangeDone` event debounced. It use `lodash#debounce` method to delay function call.
+		 * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
 		 *
 		 * @private
 		 * @param {Object} data Selection change data.

+ 2 - 2
packages/ckeditor5-engine/src/view/observer/selectionobserver.js

@@ -75,7 +75,7 @@ export default class SelectionObserver extends Observer {
 		this._documents = new WeakSet();
 
 		/**
-		 * Fires `selectionChangeDone` event debounced. It use `lodash#debounce` method to delay function call.
+		 * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
 		 *
 		 * @private
 		 * @param {Object} data Selection change data.
@@ -254,7 +254,7 @@ export default class SelectionObserver extends Observer {
  */
 
 /**
- * Fired when selection stop changing.
+ * Fired when selection stops changing.
  *
  * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  *

+ 4 - 6
packages/ckeditor5-engine/tests/view/observer/fakeselectionobserver.js

@@ -101,9 +101,6 @@ describe( 'FakeSelectionObserver', () => {
 	} );
 
 	it( 'should fire `selectionChangeDone` event after selection stop changing', ( done ) => {
-		// Note that it's difficult to test lodash#debounce with sinon fake timers.
-		// See: https://github.com/lodash/lodash/issues/304
-
 		const spy = sinon.spy();
 
 		viewDocument.on( 'selectionChangeDone', spy );
@@ -112,6 +109,8 @@ describe( 'FakeSelectionObserver', () => {
 		changeFakeSelectionPressing( keyCodes.arrowdown );
 
 		// Wait 100ms.
+		// Note that it's difficult/not possible to test lodash#debounce with sinon fake timers.
+		// See: https://github.com/lodash/lodash/issues/304
 		setTimeout( () => {
 			// Check if spy was called.
 			expect( spy.notCalled ).to.true;
@@ -129,9 +128,6 @@ describe( 'FakeSelectionObserver', () => {
 	} );
 
 	it( 'should not fire `selectionChangeDone` event when observer will be destroyed', ( done ) => {
-		// Note that it's difficult to test lodash#debounce with sinon fake timers.
-		// See: https://github.com/lodash/lodash/issues/304
-
 		const spy = sinon.spy();
 
 		viewDocument.on( 'selectionChangeDone', spy );
@@ -140,6 +136,8 @@ describe( 'FakeSelectionObserver', () => {
 		changeFakeSelectionPressing( keyCodes.arrowdown );
 
 		// Wait 100ms.
+		// Note that it's difficult/not possible to test lodash#debounce with sinon fake timers.
+		// See: https://github.com/lodash/lodash/issues/304
 		setTimeout( () => {
 			// And destroy observer.
 			observer.destroy();

+ 4 - 6
packages/ckeditor5-engine/tests/view/observer/selectionobserver.js

@@ -228,9 +228,6 @@ describe( 'SelectionObserver', () => {
 	} );
 
 	it( 'should fire `selectionChangeDone` event after selection stop changing', ( done ) => {
-		// Note that it's difficult to test lodash#debounce with sinon fake timers.
-		// See: https://github.com/lodash/lodash/issues/304
-
 		const spy = sinon.spy();
 
 		viewDocument.on( 'selectionChangeDone', spy );
@@ -239,6 +236,8 @@ describe( 'SelectionObserver', () => {
 		changeDomSelection();
 
 		// Wait 100ms.
+		// Note that it's difficult/not possible to test lodash#debounce with sinon fake timers.
+		// See: https://github.com/lodash/lodash/issues/304
 		setTimeout( () => {
 			// Check if spy was called.
 			expect( spy.notCalled ).to.true;
@@ -273,9 +272,6 @@ describe( 'SelectionObserver', () => {
 	} );
 
 	it( 'should not fire `selectionChangeDone` event when observer will be destroyed', ( done ) => {
-		// Note that it's difficult to test lodash#debounce with sinon fake timers.
-		// See: https://github.com/lodash/lodash/issues/304
-
 		const spy = sinon.spy();
 
 		viewDocument.on( 'selectionChangeDone', spy );
@@ -284,6 +280,8 @@ describe( 'SelectionObserver', () => {
 		changeDomSelection();
 
 		// Wait 100ms.
+		// Note that it's difficult/not possible to test lodash#debounce with sinon fake timers.
+		// See: https://github.com/lodash/lodash/issues/304
 		setTimeout( () => {
 			// And destroy observer.
 			selectionObserver.destroy();