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