aboutsummaryrefslogtreecommitdiff
path: root/js/panels/presets/transitions-presets.reel/transitions-presets.js
diff options
context:
space:
mode:
authorhwc4872012-04-05 17:09:51 -0700
committerhwc4872012-04-05 17:09:51 -0700
commit2d21b01d6dd64af643f5f38818b57fcace05ea0b (patch)
tree44fac83294dae2efad48389ddb44cb1dbe06caad /js/panels/presets/transitions-presets.reel/transitions-presets.js
parent7656b6eac7aec59697c6cddbe2a507fe9e4aa187 (diff)
parent96bfeee2e6b735b87e8482d6e2cf24d5224c6417 (diff)
downloadninja-2d21b01d6dd64af643f5f38818b57fcace05ea0b.tar.gz
Merge branch 'Snapping' of github.com:ericmueller/ninja-internal into Snapping_II
Diffstat (limited to 'js/panels/presets/transitions-presets.reel/transitions-presets.js')
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/js/panels/presets/transitions-presets.reel/transitions-presets.js b/js/panels/presets/transitions-presets.reel/transitions-presets.js
index 4ca2a662..05f917c4 100644
--- a/js/panels/presets/transitions-presets.reel/transitions-presets.js
+++ b/js/panels/presets/transitions-presets.reel/transitions-presets.js
@@ -22,7 +22,25 @@ exports.TransitionsLibrary = Montage.create(Component, {
22 }, 22 },
23 handleNodeActivation: { 23 handleNodeActivation: {
24 value: function(presetData) { 24 value: function(presetData) {
25 this.application.ninja.presetsController.applyPreset(presetData); 25 var selection = this.application.ninja.selectedElements,
26 stylesController = this.application.ninja.stylesController,
27 selectorBase = presetData.selectorBase,
28 self = this;
29
30 if(!selection || !selection.length || selection.length === 0) {
31 return false;
32 }
33
34 selectorBase = stylesController.generateClassName(selectorBase);
35
36 presetData.rules.forEach(function(rule) {
37 this.application.ninja.stylesController.addRule('.' + selectorBase + rule.selectorSuffix, rule.styles);
38 }, this);
39
40 selection.forEach(function(el) {
41 el._element.classList.add(selectorBase);
42 }, this);
43
26 } 44 }
27 } 45 }
28}); 46});