From aabb48a1c8d34bc968f4c6b0ffee4e31c1d5d286 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 2 Mar 2012 11:22:44 -0800 Subject: Presets Panel - Fix single-click activation, and transition cut-off bug. Use double-click as the activation event for transition presets. Also fixed the bug when applying a style preset before the transition preset, which disabled transitions after the first one. --- js/panels/presets/style-presets.reel/style-presets.js | 4 +++- js/panels/presets/transitions-presets.reel/transitions-presets.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'js/panels/presets') diff --git a/js/panels/presets/style-presets.reel/style-presets.js b/js/panels/presets/style-presets.reel/style-presets.js index 7871683e..11f41822 100644 --- a/js/panels/presets/style-presets.reel/style-presets.js +++ b/js/panels/presets/style-presets.reel/style-presets.js @@ -47,9 +47,11 @@ exports.StylesLibrary = Montage.create(Component, { selection.forEach(function(el) { el._element.style.webkitTransition = "all 450ms linear"; - el._element.addEventListener("webkitTransitionEnd", function(e) { + el._element.addEventListener("webkitTransitionEnd", function presetTransition(e) { el._element.style.webkitTransition = ''; setStopRuleSelector("*"); + this.removeEventListener("webkitTransitionEnd", presetTransition, true); + }, true); setStopRuleSelector("transitionStopRule"); el._element.classList.add(selectorBase); diff --git a/js/panels/presets/transitions-presets.reel/transitions-presets.html b/js/panels/presets/transitions-presets.reel/transitions-presets.html index c22ed351..5dc28edf 100644 --- a/js/panels/presets/transitions-presets.reel/transitions-presets.html +++ b/js/panels/presets/transitions-presets.reel/transitions-presets.html @@ -40,6 +40,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "element" : {"#": "libraryContainer"}, "branchComponent" : {"@": "branch" }, "contentController": {"@": "presetsController"}, + "activationEvent" : "dblclick", "showRoot": false } }, -- cgit v1.2.3