aboutsummaryrefslogtreecommitdiff
path: root/js/clipboard/internal-ops
diff options
context:
space:
mode:
authorAnanya Sen2012-06-29 16:17:13 -0700
committerAnanya Sen2012-06-29 16:17:13 -0700
commitd7441481d8a1032a555cbdc26996a4202e424b22 (patch)
tree5609d2aa952433cec597a58625cb9e074b59dfde /js/clipboard/internal-ops
parentccd9dd85d39b338c19d51e34b446b126061b07fb (diff)
downloadninja-d7441481d8a1032a555cbdc26996a4202e424b22.tar.gz
Fixed IKNINJA-1763, IKNINJA-1807 - refresh stage after loading is done for image and svg
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/clipboard/internal-ops')
-rw-r--r--js/clipboard/internal-ops/elements-clipboard-agent.js10
1 files changed, 9 insertions, 1 deletions
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
325 325
326 pastePositioned:{ 326 pastePositioned:{
327 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste 327 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste
328 var modObject = [], x,y, newX, newY, counter; 328 var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true;
329 329
330 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ 330 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){
331 counter = this.pasteCounter; 331 counter = this.pasteCounter;
@@ -341,6 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
341 if(!styles || (styles && !styles.position)){ 341 if(!styles || (styles && !styles.position)){
342 this.application.ninja.elementMediator.addElements(element, null, false); 342 this.application.ninja.elementMediator.addElements(element, null, false);
343 }else if(styles && (styles.position === "absolute")){ 343 }else if(styles && (styles.position === "absolute")){
344 if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){
345 element.onload = function(){
346 element.onload = null;
347 //refresh selection
348 self.application.ninja.stage.needsDraw = true;
349 }
350 }
351
344 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace 352 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace
345 } 353 }
346 } 354 }