diff options
Diffstat (limited to 'js/mediators')
-rwxr-xr-x | js/mediators/element-mediator.js | 17 | ||||
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 7 |
2 files changed, 16 insertions, 8 deletions
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 611cf214..33377d72 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -295,10 +295,10 @@ exports.ElementMediator = Montage.create(Component, { | |||
295 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 295 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
296 | */ | 296 | */ |
297 | setColor: { | 297 | setColor: { |
298 | value: function(els, value, isFill, eventType, source, currentValue) { | 298 | value: function(els, value, isFill, eventType, source, currentValue,borderSide) { |
299 | 299 | ||
300 | if(eventType === "Changing") { | 300 | if(eventType === "Changing") { |
301 | this._setColor(els, value, isFill, eventType, source); | 301 | this._setColor(els, value, isFill, eventType, source,borderSide); |
302 | } else { | 302 | } else { |
303 | // Calculate currentValue if not found for each element | 303 | // Calculate currentValue if not found for each element |
304 | if(!currentValue) { | 304 | if(!currentValue) { |
@@ -317,11 +317,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
317 | _source: { value: "undo-redo"}, | 317 | _source: { value: "undo-redo"}, |
318 | description: { value: "Set Color"}, | 318 | description: { value: "Set Color"}, |
319 | receiver: { value: this}, | 319 | receiver: { value: this}, |
320 | _borderSide: { value: borderSide}, | ||
320 | 321 | ||
321 | execute: { | 322 | execute: { |
322 | value: function(senderObject) { | 323 | value: function(senderObject) { |
323 | if(senderObject) this._source = senderObject; | 324 | if(senderObject) this._source = senderObject; |
324 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source); | 325 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source,this._borderSide); |
325 | this._source = "undo-redo"; | 326 | this._source = "undo-redo"; |
326 | return ""; | 327 | return ""; |
327 | } | 328 | } |
@@ -343,12 +344,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
343 | }, | 344 | }, |
344 | 345 | ||
345 | _setColor: { | 346 | _setColor: { |
346 | value: function(els, value, isFill, eventType, source) { | 347 | value: function(els, value, isFill, eventType, source,borderSide) { |
347 | for(var i=0, item; item = els[i]; i++) { | 348 | for(var i=0, item; item = els[i]; i++) { |
348 | item.elementModel.controller["setColor"](item, value, isFill); | 349 | item.elementModel.controller["setColor"](item, value, isFill,borderSide); |
349 | } | 350 | } |
350 | 351 | ||
351 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); | 352 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill, "borderSide":borderSide}, redraw: null}); |
352 | } | 353 | } |
353 | }, | 354 | }, |
354 | 355 | ||
@@ -490,9 +491,9 @@ exports.ElementMediator = Montage.create(Component, { | |||
490 | length = layersDraggedArray.length; | 491 | length = layersDraggedArray.length; |
491 | 492 | ||
492 | for(var i=0; documentRoot.children[i]; i++) { | 493 | for(var i=0; documentRoot.children[i]; i++) { |
493 | if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { | 494 | if(documentRoot.children[i] === layerDroppedAfter.layerData.stageElement) { |
494 | if(length >0){ | 495 | if(length >0){ |
495 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); | 496 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.stageElement, documentRoot.children[i]); |
496 | } | 497 | } |
497 | 498 | ||
498 | /* Will require for Multiple Drag n Drop */ | 499 | /* Will require for Multiple Drag n Drop */ |
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 196c8a4b..cce053bc 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js | |||
@@ -50,6 +50,7 @@ var Keyboard = exports.Keyboard = { | |||
50 | X:88, | 50 | X:88, |
51 | Y:89, | 51 | Y:89, |
52 | Z:90, | 52 | Z:90, |
53 | F6:117, | ||
53 | PLUS:187, | 54 | PLUS:187, |
54 | MINUS:189 | 55 | MINUS:189 |
55 | }; | 56 | }; |
@@ -215,6 +216,12 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
215 | return; | 216 | return; |
216 | } | 217 | } |
217 | 218 | ||
219 | // F6 keyboard shortcut to add a keyframe to the timeline | ||
220 | if (evt.keyCode == Keyboard.F6) { | ||
221 | this.application.ninja.timeline.handleKeyframeShortcut(); | ||
222 | return; | ||
223 | } | ||
224 | |||
218 | // Check if cmd+a/ctrl+a for Select All | 225 | // Check if cmd+a/ctrl+a for Select All |
219 | if((evt.keyCode == Keyboard.A) && (evt.ctrlKey || evt.metaKey)) { | 226 | if((evt.keyCode == Keyboard.A) && (evt.ctrlKey || evt.metaKey)) { |
220 | NJevent("selectAll"); | 227 | NJevent("selectAll"); |