-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from nymag/invisible-spaces
Invisible spaces
- Loading branch information
Showing
10 changed files
with
380 additions
and
39 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
var selector = require('./services/selector'), | ||
SpaceController = require('./controllers/space-controller'), | ||
invisibleLists = require('./services/invisible-lists'), | ||
utils = require('./services/utils'); | ||
|
||
// Load styles | ||
require('./styleguide/styles.scss'); | ||
|
||
function updateSelector(el, options, parent) { | ||
var isSpaceComponent = utils.checkIfSpace(options.ref), | ||
availableSpaces = utils.spaceInComponentList(parent); | ||
var isSpaceComponent, availableSpaces; | ||
|
||
if (utils.checkIfSpaceEdit(options.ref)) { | ||
return; | ||
} | ||
|
||
isSpaceComponent = utils.checkIfSpace(options.ref); | ||
availableSpaces = utils.spaceInComponentList(parent); | ||
|
||
if (availableSpaces && availableSpaces.length > 0 && !isSpaceComponent) { | ||
selector.addAvailableSpaces(el, availableSpaces); | ||
selector.addCreateSpaceButton(el, options, parent); | ||
selector.stripSpaceFromComponentList(el); | ||
|
||
} | ||
|
||
if (isSpaceComponent) { | ||
selector.addAvailableSpaces(el, availableSpaces); | ||
SpaceController(el, parent); | ||
selector.addToComponentList(el, options, parent); | ||
|
||
} | ||
} | ||
|
||
window.kiln = window.kiln || {}; | ||
window.kiln.plugins = window.kiln.plugins || {}; | ||
window.kiln.plugins['spaces-edit'] = function initSpaces() { | ||
window.kiln.on('add-selector', updateSelector); | ||
window.kiln.on('component-pane:create-invisible-tab', invisibleLists); | ||
}; |
Oops, something went wrong.