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 017ed20a..bd0ae3cb 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -294,10 +294,10 @@ exports.ElementMediator = Montage.create(Component, { | |||
294 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline | 294 | @param stageRedraw: *OPTIONAL*: True. If set to false the stage will not redraw the selection/outline |
295 | */ | 295 | */ |
296 | setColor: { | 296 | setColor: { |
297 | value: function(els, value, isFill, eventType, source, currentValue) { | 297 | value: function(els, value, isFill, eventType, source, currentValue,borderSide) { |
298 | 298 | ||
299 | if(eventType === "Changing") { | 299 | if(eventType === "Changing") { |
300 | this._setColor(els, value, isFill, eventType, source); | 300 | this._setColor(els, value, isFill, eventType, source,borderSide); |
301 | } else { | 301 | } else { |
302 | // Calculate currentValue if not found for each element | 302 | // Calculate currentValue if not found for each element |
303 | if(!currentValue) { | 303 | if(!currentValue) { |
@@ -316,11 +316,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
316 | _source: { value: "undo-redo"}, | 316 | _source: { value: "undo-redo"}, |
317 | description: { value: "Set Color"}, | 317 | description: { value: "Set Color"}, |
318 | receiver: { value: this}, | 318 | receiver: { value: this}, |
319 | _borderSide: { value: borderSide}, | ||
319 | 320 | ||
320 | execute: { | 321 | execute: { |
321 | value: function(senderObject) { | 322 | value: function(senderObject) { |
322 | if(senderObject) this._source = senderObject; | 323 | if(senderObject) this._source = senderObject; |
323 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source); | 324 | this.receiver._setColor(this._els, this._value, this._isFill, this._eventType, this._source,this._borderSide); |
324 | this._source = "undo-redo"; | 325 | this._source = "undo-redo"; |
325 | return ""; | 326 | return ""; |
326 | } | 327 | } |
@@ -342,12 +343,12 @@ exports.ElementMediator = Montage.create(Component, { | |||
342 | }, | 343 | }, |
343 | 344 | ||
344 | _setColor: { | 345 | _setColor: { |
345 | value: function(els, value, isFill, eventType, source) { | 346 | value: function(els, value, isFill, eventType, source,borderSide) { |
346 | for(var i=0, item; item = els[i]; i++) { | 347 | for(var i=0, item; item = els[i]; i++) { |
347 | item.elementModel.controller["setColor"](item, value, isFill); | 348 | item.elementModel.controller["setColor"](item, value, isFill,borderSide); |
348 | } | 349 | } |
349 | 350 | ||
350 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill}, redraw: null}); | 351 | NJevent("element" + eventType, {type : "setColor", source: source, data: {"els": els, "prop": "color", "value": value, "isFill": isFill, "borderSide":borderSide}, redraw: null}); |
351 | } | 352 | } |
352 | }, | 353 | }, |
353 | 354 | ||
@@ -489,9 +490,9 @@ exports.ElementMediator = Montage.create(Component, { | |||
489 | length = layersDraggedArray.length; | 490 | length = layersDraggedArray.length; |
490 | 491 | ||
491 | for(var i=0; documentRoot.children[i]; i++) { | 492 | for(var i=0; documentRoot.children[i]; i++) { |
492 | if(documentRoot.children[i] === layerDroppedAfter.layerData.elementsList[0]) { | 493 | if(documentRoot.children[i] === layerDroppedAfter.layerData.stageElement) { |
493 | if(length >0){ | 494 | if(length >0){ |
494 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.elementsList[0], documentRoot.children[i]); | 495 | documentRoot.children[i].parentNode.insertBefore(layersDraggedArray[length-1].layerData.stageElement, documentRoot.children[i]); |
495 | } | 496 | } |
496 | 497 | ||
497 | /* Will require for Multiple Drag n Drop */ | 498 | /* 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"); |