Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #123 from ckeditor/t/120
Browse files Browse the repository at this point in the history
Other: Removed loadDataFromElement method from ElementApiMixin. Closes #120.
  • Loading branch information
Piotr Jasiun authored Mar 9, 2018
2 parents 4613e6b + 6440897 commit 4976e10
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
14 changes: 0 additions & 14 deletions src/editor/utils/elementapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* For licensing, see LICENSE.md.
*/

import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement';
import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement';

/**
Expand All @@ -22,13 +21,6 @@ const ElementApiMixin = {
*/
updateElement() {
setDataInElement( this.element, this.data.get() );
},

/**
* @inheritDoc
*/
loadDataFromElement() {
this.data.set( getDataFromElement( this.element ) );
}
};

Expand All @@ -52,9 +44,3 @@ export default ElementApiMixin;
*
* @method #updateElement
*/

/**
* Loads the data from the {@link #element editor element} to the main root.
*
* @method #loadDataFromElement
*/
3 changes: 2 additions & 1 deletion tests/_utils/classictesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ClassicTestEditorUI from './classictesteditorui';
import BoxedEditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview';
import ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer';
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement';
import mix from '@ckeditor/ckeditor5-utils/src/mix';

/**
Expand Down Expand Up @@ -71,7 +72,7 @@ export default class ClassicTestEditor extends Editor {
editor.fire( 'uiReady' );
} )
.then( () => editor.editing.view.attachDomRoot( editor.ui.view.editableElement ) )
.then( () => editor.loadDataFromElement() )
.then( () => editor.data.init( getDataFromElement( element ) ) )
.then( () => {
editor.fire( 'dataReady' );
editor.fire( 'ready' );
Expand Down
17 changes: 0 additions & 17 deletions tests/editor/utils/elementapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@ describe( 'ElementApiMixin', () => {
editor.destroy();
} );

describe( 'loadDataFromElement()', () => {
it( 'should be added to editor interface', () => {
expect( editor ).have.property( 'loadDataFromElement' ).to.be.a( 'function' );
} );

it( 'sets data to editor element', () => {
const editorElement = document.createElement( 'div' );

editor.element = editorElement;
editorElement.innerHTML = 'foo bar';

editor.loadDataFromElement();

expect( editorElement.innerHTML ).to.equal( 'foo bar' );
} );
} );

describe( 'updateEditorElement()', () => {
it( 'should be added to editor interface', () => {
expect( editor ).have.property( 'updateElement' ).to.be.a( 'function' );
Expand Down

0 comments on commit 4976e10

Please sign in to comment.