From 6aca635e82d7f5c1e3f6a4964d041c1d8eb3f306 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 15 Jun 2012 17:07:58 -0700 Subject: Fixed - IKNINJA-1748 - While pasting text in any text field in the PI, the text gets pasted on the stage Signed-off-by: Ananya Sen --- js/controllers/clipboard-controller.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index c8520e04..db581d37 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -82,6 +82,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; }//for design view only + // Don't do anything if an input or other control is focused + if(document.activeElement.nodeName !== "BODY") { + return; + } + this.copy(clipboardEvent); clipboardEvent.preventDefault(); @@ -92,6 +97,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component value:function(clipboardEvent){ if(this.application.ninja.currentDocument.currentView === "code") return; + // Don't do anything if an input or other control is focused + if(document.activeElement.nodeName !== "BODY") { + return; + } + this.cut(clipboardEvent); clipboardEvent.preventDefault(); @@ -113,6 +123,11 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component return; }//for design view only + // Don't do anything if an input or other control is focused + if(document.activeElement.nodeName !== "BODY") { + return; + } + //TODO: return if stage is not focussed this.pasteCounter++; -- cgit v1.2.3