From 3487d0596ff64a3bfbfc00e8187e34d9eb2ba0ab Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 29 Jun 2012 13:23:30 -0700 Subject: Timeline: Bug fix: IKNINJA-1857, "Using keyboard shortcut for chrome-preview causes each layer in the timeline to remain selected even when clicking on another layer." --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b0ab3b19..4c349247 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -1369,8 +1369,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { targetIndex = 0, isAlreadySelected = false, indexAlreadySelected = 0, - indexLastClicked = 0; - + indexLastClicked = 0, + ua = navigator.userAgent.toLowerCase(), + boolCommandControlKeyIsPressed = false; + + // Check to see if either the Command key (macs) or Control key (windows) is being pressed + if (ua.indexOf("mac") > -1) { + if (event.metaKey === true) { + boolCommandControlKeyIsPressed = true; + } + } else { + if (this._isControlPressed === true) { + boolCommandControlKeyIsPressed = true; + } + } + // Did the mousedown event originate within a layer? if (ptrParent === false) { // No it did not. Do nothing. @@ -1406,8 +1419,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } else { // Something is already selected. What do do depends on whether // or not other keys are pressed. - if (this._isControlPressed === true) { - // Control key is being pressed, so we need to + if (boolCommandControlKeyIsPressed === true) { + // Control or Command key is being pressed, so we need to // either add the current layer to selectedLayers // or remove it if it's already there. if (this.currentLayersSelected === false) { @@ -1467,9 +1480,11 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Control key has been pressed this._isControlPressed = true; } + /* if (event.metaKey === true) { this._isControlPressed = true; } + */ } }, -- cgit v1.2.3