Преглед на файлове

Internal: updated the API usage to reflect current widget resizer implementation.

Marek Lewandowski преди 6 години
родител
ревизия
8befac2ab7

+ 1 - 5
packages/ckeditor5-image/src/image/utils.js

@@ -22,11 +22,7 @@ import { findOptimalInsertionPosition, isWidget, toWidget } from '@ckeditor/cked
 export function toImageWidget( viewElement, writer, label ) {
 	writer.setCustomProperty( 'image', true, viewElement );
 
-	return toWidget( viewElement, writer, {
-		label: labelCreator,
-		features: [
-		]
-	} );
+	return toWidget( viewElement, writer, { label: labelCreator } );
 
 	function labelCreator() {
 		const imgElement = viewElement.getChild( 0 );

+ 1 - 1
packages/ckeditor5-image/tests/manual/image.html

@@ -1,7 +1,7 @@
 <div id="editor">
 	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla finibus consequat placerat. Vestibulum id tellus et mauris sagittis tincidunt quis id mauris. Curabitur consectetur lectus sit amet tellus mattis, non lobortis leo interdum. </p>
 	<figure class="image image-style-side">
-		<img src="sample.jpg" alt="" />
+		<img src="sample.jpg" alt="" height="60" />
 	</figure>
 	<figure class="image">
 		<img src="sample.jpg" alt="" />

+ 1 - 37
packages/ckeditor5-image/tests/manual/image.js

@@ -14,45 +14,9 @@ import ImagePlugin from '../../src/image';
 import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
 import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 
-import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-
-class ResizeFeaturePlugin extends Plugin {
-	init() {
-		const view = this.editor.editing.view;
-		const viewDocument = view.document;
-
-		this.listenTo( viewDocument, 'selectionChange', ( ...args ) => this._onSelectionChange( ...args ) );
-		// viewDocument.selection.on( 'change', this._onSelectionChange );
-	}
-
-	_onSelectionChange( eventInfo, data ) {
-		console.log( 'sel change' );
-		const selection = data.newSelection;
-		const selectedElement = selection.getSelectedElement();
-
-		if ( selectedElement && selectedElement.hasClass( 'ck-widget' ) ) {
-
-			// const mapper = this.editor.editing.mapper;
-			// const modelElement = mapper.toModelElement( selectedElement );
-			// foo
-		}
-
-		console.log( selectedElement );
-	}
-}
-
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
-		plugins: [
-			EnterPlugin,
-			TypingPlugin,
-			ParagraphPlugin,
-			HeadingPlugin,
-			ImagePlugin,
-			UndoPlugin,
-			ClipboardPlugin,
-			ResizeFeaturePlugin
-		],
+		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin ],
 		toolbar: [ 'heading', '|', 'undo', 'redo' ]
 	} )
 	.then( editor => {