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

Commit

Permalink
Additional fixed and improved docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Piechaczek committed Mar 29, 2018
1 parent 262c8e3 commit 05adc46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/view/elementdefinition.jsdoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* const viewDefinition = {
* name: 'h1',
* class: [ 'foo', 'bar' ]
* classes: [ 'foo', 'bar' ]
* };
*
* Above describes a view element:
Expand All @@ -23,11 +23,11 @@
*
* const viewDefinition = {
* name: 'span',
* style: {
* styles: {
* 'font-size': '12px',
* 'font-weight': 'bold'
* },
* attribute: {
* attributes: {
* 'data-id': '123'
* }
* };
Expand All @@ -49,10 +49,10 @@
* @typedef {String|Object} module:engine/view/elementdefinition~ElementDefinition
*
* @property {String} name View element name.
* @property {String|Array.<String>} [class] Class name or array of class names to match. Each name can be
* @property {String|Array.<String>} [classes] Class name or array of class names to match. Each name can be
* provided in a form of string.
* @property {Object} [style] Object with key-value pairs representing styles. Each object key represents style name.
* @property {Object} [styles] Object with key-value pairs representing styles. Each object key represents style name.
* Value under that key must be a string.
* @property {Object} [attribute] Object with key-value pairs representing attributes. Each object key represents
* @property {Object} [attributes] Object with key-value pairs representing attributes. Each object key represents
* attribute name. Value under that key must be a string.
*/
12 changes: 6 additions & 6 deletions tests/view/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ describe( 'Renderer', () => {

// Insert space resulting in '<p>x <b> y</b></p>'.
viewP._removeChildren( 0 );
viewP._insertChildren( 0, new ViewText( 'x ' ) );
viewP._insertChild( 0, new ViewText( 'x ' ) );

renderer.markToSync( 'children', viewP );
renderer.render();
Expand Down Expand Up @@ -1481,7 +1481,7 @@ describe( 'Renderer', () => {
// Insert space resulting in '<p><b>x </b> y</p>'.
const viewB = viewP.getChild( 0 );
viewB._removeChildren( 0 );
viewB._insertChildren( 0, new ViewText( 'x ' ) );
viewB._insertChild( 0, new ViewText( 'x ' ) );

renderer.markToSync( 'children', viewP );
renderer.render();
Expand Down Expand Up @@ -1511,7 +1511,7 @@ describe( 'Renderer', () => {
// Insert space resulting in '<p><b>x </b><i> y</i></p>'.
const viewB = viewP.getChild( 0 );
viewB._removeChildren( 0 );
viewB._insertChildren( 0, new ViewText( 'x ' ) );
viewB._insertChild( 0, new ViewText( 'x ' ) );

renderer.markToSync( 'children', viewP );
renderer.render();
Expand Down Expand Up @@ -1563,7 +1563,7 @@ describe( 'Renderer', () => {
// '<h2>He<i>ading 1</i></h2>' -> '<h2>Heading 2</h2>'
const viewHeading = viewRoot.getChild( 0 );
viewHeading._removeChildren( 0, viewHeading.childCount );
viewHeading._insertChildren( 0, new ViewText( 'Heading 2' ) );
viewHeading._insertChild( 0, new ViewText( 'Heading 2' ) );

// Usually whole subtree is marked to sync so we mark root, changed element and all its direct children.
renderer.markToSync( 'children', viewRoot );
Expand All @@ -1575,7 +1575,7 @@ describe( 'Renderer', () => {
// '<p>Ph <i><strong>Italic</strong></i> <a><strong>L</strong>ink 1</a></p>'
const viewP = viewRoot.getChild( 1 );
viewP._removeChildren( 0, viewP.childCount );
viewP._insertChildren(
viewP._insertChild(
0,
parse(
'Ph <attribute:i><attribute:strong>Italic</attribute:strong></attribute:i> ' +
Expand All @@ -1594,7 +1594,7 @@ describe( 'Renderer', () => {
// -> '<blockquote><p>Qu<strong>ote</strong></p><ul><li><strong>Quoted item 1</strong></li></ul></blockquote>'
const viewBq = viewRoot.getChild( 2 );
viewBq._removeChildren( 0, viewBq.childCount );
viewBq._insertChildren(
viewBq._insertChild(
0,
parse(
'<container:p>Qu<attribute:strong>ote</attribute:strong></container:p>' +
Expand Down

0 comments on commit 05adc46

Please sign in to comment.