Skip to content

Commit

Permalink
Merge pull request #42 from nymag/new-selectors-update
Browse files Browse the repository at this point in the history
New selectors update
  • Loading branch information
jonwinton authored Sep 30, 2016
2 parents fcd3764 + debc39f commit 5319b4a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 50 deletions.
4 changes: 1 addition & 3 deletions src/controllers/space-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function SpaceController(el, parent) {
} else if (isLogicElement && componentElement) {
saveService.call(this, component, componentElement);
}

});


Expand Down Expand Up @@ -91,6 +90,7 @@ proto.onAddCallback = function (newEl) {
*/
proto.updateChildrenCount = function () {
this.childrenLogics = utils.findAllLogic(this.el);

return this;
};

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/services/logic-readout-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
18 changes: 0 additions & 18 deletions src/services/select-space-parent.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/services/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions template.nunjucks
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@
</button>
</template>

{# Select Space Parent #}
<template class="parent-space">
<button type="button" class="selector-button space-parent">
{% include 'public/media/components/clay-kiln/parent.svg' %}
</button>
</template>

{# Readout Icons #}
{# Need more icons? Submit a PR to https://github.com/nymag/clay-space-edit with the icon #}
<template class="clay-space-edit-icons">
Expand Down

0 comments on commit 5319b4a

Please sign in to comment.