From d7441481d8a1032a555cbdc26996a4202e424b22 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 29 Jun 2012 16:17:13 -0700 Subject: Fixed IKNINJA-1763, IKNINJA-1807 - refresh stage after loading is done for image and svg Signed-off-by: Ananya Sen --- js/clipboard/internal-ops/elements-clipboard-agent.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 1a4bfdba..a8bd3b2d 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -325,7 +325,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com pastePositioned:{ value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste - var modObject = [], x,y, newX, newY, counter; + var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true; if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ counter = this.pasteCounter; @@ -341,6 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com if(!styles || (styles && !styles.position)){ this.application.ninja.elementMediator.addElements(element, null, false); }else if(styles && (styles.position === "absolute")){ + if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){ + element.onload = function(){ + element.onload = null; + //refresh selection + self.application.ninja.stage.needsDraw = true; + } + } + this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace } } -- cgit v1.2.3 From d00207263caf6b8196b991a681e826b658d0712c Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 29 Jun 2012 16:19:48 -0700 Subject: removing unnecessary variable Signed-off-by: Ananya Sen --- js/clipboard/internal-ops/elements-clipboard-agent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index a8bd3b2d..1f3db331 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -325,7 +325,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com pastePositioned:{ value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste - var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true; + var modObject = [], x,y, newX, newY, counter, self = this; if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ counter = this.pasteCounter; -- cgit v1.2.3 From fdf2411fbf8d2d5ec710dded859bb5fa29e867d6 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 2 Jul 2012 13:29:02 -0700 Subject: IKNinja-1736 and IKNinja-1802 - Copy paste WebGL bugs. Signed-off-by: Nivesh Rajbhandari --- js/clipboard/internal-ops/elements-clipboard-agent.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 1a4bfdba..ef89ab35 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -243,7 +243,10 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com styles = null; } + var addDelegate = this.application.ninja.elementMediator.addDelegate; + this.application.ninja.elementMediator.addDelegate = null; this.application.ninja.elementMediator.addElements(canvas, styles, false); + this.application.ninja.elementMediator.addDelegate = addDelegate; worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null; if(worldData) @@ -338,11 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com newX = styles ? ("" + (styles.left + (25 * counter)) + "px") : "100px"; newY = styles ? ("" + (styles.top + (25 * counter)) + "px") : "100px"; + var addDelegate = this.application.ninja.elementMediator.addDelegate; + this.application.ninja.elementMediator.addDelegate = null; if(!styles || (styles && !styles.position)){ this.application.ninja.elementMediator.addElements(element, null, false); }else if(styles && (styles.position === "absolute")){ this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace } + this.application.ninja.elementMediator.addDelegate = addDelegate; } }, -- cgit v1.2.3 From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/clipboard/internal-ops/component-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/css-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/elements-clipboard-agent.js | 4 ++-- js/clipboard/internal-ops/timeline-clipboard-agent.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'js/clipboard/internal-ops') diff --git a/js/clipboard/internal-ops/component-clipboard-agent.js b/js/clipboard/internal-ops/component-clipboard-agent.js index 3dc41532..31b53474 100644 --- a/js/clipboard/internal-ops/component-clipboard-agent.js +++ b/js/clipboard/internal-ops/component-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var ComponentsClipboardAgent = exports.ComponentsClipboardAgent = Montage.create(Component, { diff --git a/js/clipboard/internal-ops/css-clipboard-agent.js b/js/clipboard/internal-ops/css-clipboard-agent.js index 42dd09c9..e93077a8 100644 --- a/js/clipboard/internal-ops/css-clipboard-agent.js +++ b/js/clipboard/internal-ops/css-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var CssClipboardAgent = exports.CssClipboardAgent = Montage.create(Component, { diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index 14984593..5c4b7d6f 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, ClipboardUtil = require("js/clipboard/util").ClipboardUtil, World = require("js/lib/drawing/world").World; diff --git a/js/clipboard/internal-ops/timeline-clipboard-agent.js b/js/clipboard/internal-ops/timeline-clipboard-agent.js index d8ef7ae9..4e5cfe30 100644 --- a/js/clipboard/internal-ops/timeline-clipboard-agent.js +++ b/js/clipboard/internal-ops/timeline-clipboard-agent.js @@ -31,8 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////////////////// // -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; var TimelineClipboardAgent = exports.TimelineClipboardAgent = Montage.create(Component, { -- cgit v1.2.3