From 5a34cac9594d710f6e5675bee34dc16be1b4d8a0 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 16 Jul 2012 15:34:07 -0700 Subject: Fixed copy paste from external applications Signed-off-by: Ananya Sen --- js/mediators/element-mediator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 9c9518a0..4a4c9f88 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js @@ -49,7 +49,7 @@ exports.ElementMediator = Montage.create(Component, { }, addElements:{ - value:function (elements, rules, notify) { + value:function (elements, rules, notify, callAddDelegate) { if (Array.isArray(elements)) { elements.forEach(function (element) { ElementController.addElement(element, rules); @@ -61,7 +61,9 @@ exports.ElementMediator = Montage.create(Component, { } - if (this.addDelegate && typeof (this.addDelegate['onAddElements']) === "function") { + if ((callAddDelegate || (typeof callAddDelegate === "undefined")) + && this.addDelegate && typeof (this.addDelegate['onAddElements']) === "function") { + this.addDelegate['onAddElements'].call(this.addDelegate, elements); } -- cgit v1.2.3 From 16d06bac95ce8334f8c5586750e98360dbc9cbd9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Jul 2012 22:50:12 -0700 Subject: Fixing chrome preview shortcut The menu update broke the chrome preview shortcut. Updated the function name in the keyboard handler. Signed-off-by: Valerio Virgillito --- js/mediators/keyboard-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 36bc86fd..f71356b6 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -264,7 +264,7 @@ exports.KeyboardMediator = Montage.create(Component, { if((evt.keyCode == Keyboard.ENTER) && (evt.ctrlKey || evt.metaKey)) { - this.application.ninja.executeChromePreview(); + this.application.ninja.handleExecutePreview(); return; } -- cgit v1.2.3 From 6403ec6d21048c93138ddcbcc59fc4677121ed5e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 19 Jul 2012 15:53:54 -0700 Subject: Timeline: updated livePreview to timeline play. Hide canvas and draw red outline - Changed the play button to a toggle button - livePreview code in stage activated via bindings - Draw a red outline of the canvas when in play Signed-off-by: Valerio Virgillito --- js/mediators/keyboard-mediator.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index f71356b6..a323b9c3 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -98,20 +98,6 @@ exports.KeyboardMediator = Montage.create(Component, { value: function() { document.addEventListener("keydown", this, false); document.addEventListener("keyup", this, false); - - this.addPropertyChangeListener("appModel.livePreview", this.handleLivePreview, false); - } - }, - - handleLivePreview: { - value: function() { - if(this.appModel.livePreview) { - document.removeEventListener("keydown", this, false); - document.removeEventListener("keyup", this, false); - } else { - document.addEventListener("keydown", this, false); - document.addEventListener("keyup", this, false); - } } }, -- cgit v1.2.3 From 6db7685f40310683e1cb6c4e98895d2007e787dc Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 19 Jul 2012 16:24:17 -0700 Subject: IKNINJA-1899 - Fixed runtime error when undoing a delete shape action. Signed-off-by: Nivesh Rajbhandari --- js/mediators/element-mediator.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 4a4c9f88..f5b574fc 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js @@ -69,7 +69,7 @@ exports.ElementMediator = Montage.create(Component, { var undoLabel = "add element"; - document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify); + document.application.undoManager.add(undoLabel, this.removeElements, this, elements, notify, false); this.application.ninja.currentDocument.model.needsSave = true; @@ -80,9 +80,10 @@ exports.ElementMediator = Montage.create(Component, { }, removeElements:{ - value:function (elements, notify /* Used for the add undo */) { + value:function (elements, notify, callDeleteDelegate) { - if (this.deleteDelegate && (typeof this.deleteDelegate.handleDelete === 'function')) { + if ((callDeleteDelegate || (typeof callDeleteDelegate === "undefined")) + && this.deleteDelegate && (typeof this.deleteDelegate.handleDelete === 'function')) { return this.deleteDelegate.handleDelete(); // this.handleDelete.call(deleteDelegate); } @@ -98,7 +99,7 @@ exports.ElementMediator = Montage.create(Component, { var undoLabel = "add element"; - document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify); + document.application.undoManager.add(undoLabel, this.addElements, this, elements, null, notify, false); this.application.ninja.currentDocument.model.needsSave = true; -- cgit v1.2.3