From 730389f72b1f2949e74b4ce8f8625bfd8bc4fa39 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 18 Jun 2012 16:12:49 -0700 Subject: Timeline: Bug Fixes - Splitting tweens now works again for shift-click interaction - Fixed visual "jump" in keyframes and spans when splitting tweens - Set default easing to "none" to match CSS standard. --- js/panels/Timeline/EasingMenu.reel/EasingMenu.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline/EasingMenu.reel/EasingMenu.js') diff --git a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js index f0547e31..ced3ae6a 100644 --- a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js +++ b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js @@ -81,7 +81,7 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, { // currentChoice: The data attribute of the current choice _currentChoice: { - value: null + value: "none" }, currentChoice: { get: function() { @@ -109,8 +109,14 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, { draw: { value: function() { // Update the selection classes. - this.element.querySelector(".easing-selected").classList.remove("easing-selected"); - this.element.querySelector('[data-ninja-ease="'+this.currentChoice+'"]').classList.add("easing-selected"); + var easingSelected = this.element.querySelector(".easing-selected"); + if (easingSelected !== null) { + easingSelected.classList.remove("easing-selected"); + } + var dataEl = this.element.querySelector('[data-ninja-ease="'+this.currentChoice+'"]'); + if (dataEl !== null) { + dataEl.classList.add("easing-selected"); + } } }, didDraw: { @@ -147,7 +153,10 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, { event.stopPropagation(); // Un-highlight the old choice and highlight the new choice - this.element.querySelector(".easing-selected").classList.remove("easing-selected"); + var easingSelected = this.element.querySelector(".easing-selected"); + if (easingSelected !== null) { + easingSelected.classList.remove("easing-selected"); + } event.target.classList.add("easing-selected"); // Set the easing in the span that called us -- cgit v1.2.3