diff --git a/src/controllers/space-controller.js b/src/controllers/space-controller.js index 04e47a0..1639aac 100644 --- a/src/controllers/space-controller.js +++ b/src/controllers/space-controller.js @@ -43,7 +43,6 @@ function SpaceController(el, parent) { } else if (isLogicElement && componentElement) { saveService.call(this, component, componentElement); } - }); @@ -91,6 +90,7 @@ proto.onAddCallback = function (newEl) { */ proto.updateChildrenCount = function () { this.childrenLogics = utils.findAllLogic(this.el); + return this; }; @@ -129,11 +129,9 @@ proto.addButtons = function () { _.each(this.childrenLogics, (logic) => { selectorService.addBrowseButton.call(this, logic); selectorService.addRemoveButton.call(this, logic); - selectorService.swapSelectParentButton(dom.find(logic, '[data-uri]')); }); // Get count of logics - // TODO: Count on each button this.findLogicCount(); return this; diff --git a/src/services/logic-readout-service.js b/src/services/logic-readout-service.js index 272e748..68f9748 100644 --- a/src/services/logic-readout-service.js +++ b/src/services/logic-readout-service.js @@ -48,6 +48,7 @@ function logicReadouts(element) { logicString = ''; _.forIn(dataAttributes, function (value, key) { + // Check that the attribute is not in the `reservedAttributes` array if (_.startsWith(key, 'logic') && !_.includes(reservedAttributes, key)) { logicString += createReadout(element, key, value); } diff --git a/src/services/select-space-parent.js b/src/services/select-space-parent.js deleted file mode 100644 index efcfbbc..0000000 --- a/src/services/select-space-parent.js +++ /dev/null @@ -1,18 +0,0 @@ -var dom = require('@nymag/dom'), - references = require('references'); - -function selectSpaceParent(el, e) { - var spaceParent = dom.closest(el, '[data-space]'), - targetComponent = dom.closest(spaceParent.parentElement, '[data-uri]'); - - // Stop propagation to make sure the child - // component isn't selected again - e.stopPropagation(); - - // Unselect any currently selected component - references.select.unselect(); - // Select the parent - references.select.select(targetComponent); -} - -module.exports = selectSpaceParent; diff --git a/src/services/selector.js b/src/services/selector.js index 6a4bfed..b0a97da 100644 --- a/src/services/selector.js +++ b/src/services/selector.js @@ -4,9 +4,7 @@ var _ = require('lodash'), utils = require('./utils'), createService = require('./create-service'), removeService = require('./remove-service'), - selectSpaceParent = require('./select-space-parent'), statusService = require('./status-service'), - SpaceSettings = require('../controllers/space-settings-controller'); /** @@ -65,25 +63,6 @@ function addToComponentList(el, options, parent) { }); } -/** - * [swapSelectParentButton description] - * @param {[type]} el - */ -function swapSelectParentButton(el) { - var kilnParentButton = dom.find(el, '.selected-info-parent'), - kilnSettingsButton = dom.find(el, '.selected-action-settings'), - spaceParentButton = references.tpl.get('.parent-space'), - spaceButton; - - // Hide the original parent selector button provided by kiln - kilnParentButton.classList.add('kiln-hide'); - // Insert a button that will mimic the functionality of the kiln parent - dom.insertAfter(kilnSettingsButton, spaceParentButton); - - spaceButton = dom.find(el, '.space-parent'); - spaceButton.addEventListener('click', selectSpaceParent.bind(null, el)); -} - /** * [revealAddComponentButton description] * @param {[type]} el @@ -185,7 +164,6 @@ function addAvailableSpaces(el, availableSpaces) { } module.exports.addCreateSpaceButton = addCreateSpaceButton; -module.exports.swapSelectParentButton = swapSelectParentButton; module.exports.addToComponentList = addToComponentList; module.exports.launchAddComponent = launchAddComponent; module.exports.launchBrowsePane = launchBrowsePane; diff --git a/template.nunjucks b/template.nunjucks index c278bb6..4b37569 100644 --- a/template.nunjucks +++ b/template.nunjucks @@ -27,13 +27,6 @@ - {# Select Space Parent #} - - {# Readout Icons #} {# Need more icons? Submit a PR to https://github.com/nymag/clay-space-edit with the icon #}