Skip to content

Commit

Permalink
syntax fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonpecora committed Dec 15, 2016
1 parent c160610 commit 8bc6ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion behaviors/wysiwyg.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function addComponents(parent, components, options) {
var currentRef, insertIndex;

options = options || {};
currentRef = options.current && current && current.ref; // undefined if no current component
currentRef = options.current && options.current.ref; // undefined if no current component
insertIndex = options.insertIndex;

// first, create the new components
Expand Down
4 changes: 2 additions & 2 deletions services/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ function addToParentList(opts) {
* @param {object} opts
* @param {array} opts.refs
* @param {string} [opts.prevRef] The ref of the item to insert after.
* @param {number} [insertIndex] actual index to insert first item into (allows adding multiple components above existing components)
* @param {number} [opts.insertIndex] actual index to insert first item into (allows adding multiple components above existing components)
* @param {string} opts.parentField
* @param {string} opts.parentRef
* @returns {Promise} Promise resolves to new parent Element.
Expand All @@ -585,7 +585,7 @@ function addMultipleToParentList(opts) {
});

parentData = _.cloneDeep(parentData);
if (_.isNumber(insertIndex)) {
if (_.isNumber(insertIndex)) { // insertIndex might be 0, hence no truthy checking
// add to specific starting position in list
parentData[parentField].splice(insertIndex, 0, items); // note: this creates a deep array
parentData[parentField] = _.flatten(parentData[parentField]); // so flatten it afterwards
Expand Down

0 comments on commit 8bc6ae3

Please sign in to comment.