Ver código fonte

Revert "Temp: Added a quick fix for integration with Track Changes."

This reverts commit 005a5d293139ef3aee7c67d13b8a74a2c4aa2130.
Aleksander Nowodzinski 5 anos atrás
pai
commit
137bc8702a

+ 0 - 31
packages/ckeditor5-widget/src/widgettypearound/widgettypearound.js

@@ -90,9 +90,6 @@ export default class WidgetTypeAround extends Plugin {
 		this._enableTypeAroundUIInjection();
 		this._enableTypeAroundUIInjection();
 		this._enableDetectionOfTypeAroundWidgets();
 		this._enableDetectionOfTypeAroundWidgets();
 		this._enableInsertingParagraphsOnButtonClick();
 		this._enableInsertingParagraphsOnButtonClick();
-
-		// TODO: This is a quick fix and it should be removed the proper integration arrives.
-		this._enableTemporaryTrackChangesIntegration();
 	}
 	}
 
 
 	/**
 	/**
@@ -221,34 +218,6 @@ export default class WidgetTypeAround extends Plugin {
 			evt.stop();
 			evt.stop();
 		} );
 		} );
 	}
 	}
-
-	/**
-	 * A quick fix for the integration with features requiring custom handling of the `insertParagraph`
-	 * command such as Track Changes. When the `insertParagraph` command is disabled, this fix adds
-	 * a CSS class to editor roots that makes the UI disappear.
-	 *
-	 * TODO: This is a quick fix and it should be replaced by a proper integration.
-	 *
-	 * @private
-	 */
-	_enableTemporaryTrackChangesIntegration() {
-		const editor = this.editor;
-		const editingView = editor.editing.view;
-		const insertParagraphCommand = this.editor.commands.get( 'insertParagraph' );
-		const className = 'ck-widget_type-around_temp-disabled';
-
-		this.listenTo( insertParagraphCommand, 'change:isEnabled', ( evt, name, isEnabled ) => {
-			editingView.change( writer => {
-				for ( const root of editingView.document.roots ) {
-					if ( isEnabled ) {
-						writer.removeClass( className, root );
-					} else {
-						writer.addClass( className, root );
-					}
-				}
-			} );
-		} );
-	}
 }
 }
 
 
 // Injects the type around UI into a view widget instance.
 // Injects the type around UI into a view widget instance.

+ 0 - 15
packages/ckeditor5-widget/tests/widgettypearound/widgettypearound.js

@@ -312,21 +312,6 @@ describe( 'WidgetTypeAround', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( '(TEMP) "Integration" with Track Changes using CSS class on roots', () => {
-		it( 'should toggle the CSS class when the InsertParagraphCommand#isEnabled changes', () => {
-			const command = editor.commands.get( 'insertParagraph' );
-
-			expect( command.isEnabled ).to.be.true;
-			expect( viewRoot.hasClass( 'ck-widget_type-around_temp-disabled' ) ).to.be.false;
-
-			command.isEnabled = false;
-			expect( viewRoot.hasClass( 'ck-widget_type-around_temp-disabled' ) ).to.be.true;
-
-			command.isEnabled = true;
-			expect( viewRoot.hasClass( 'ck-widget_type-around_temp-disabled' ) ).to.be.false;
-		} );
-	} );
-
 	function assertIsTypeAroundBefore( viewWidget, expected ) {
 	function assertIsTypeAroundBefore( viewWidget, expected ) {
 		expect( viewWidget.hasClass( 'ck-widget_can-type-around_before' ) ).to.equal( expected );
 		expect( viewWidget.hasClass( 'ck-widget_can-type-around_before' ) ).to.equal( expected );
 	}
 	}

+ 0 - 9
packages/ckeditor5-widget/theme/widgettypearound.css

@@ -79,12 +79,3 @@
 .ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {
 .ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {
 	display: none;
 	display: none;
 }
 }
-
-/*
- * A quick fix for integration with track changes.
- *
- * TODO: To be removed when the proper integration arrives.
- */
-.ck.ck-editor__editable.ck-widget_type-around_temp-disabled .ck-widget__type-around {
-	display: none;
-}