diff options
author | John Mayhew | 2012-07-24 15:46:16 -0700 |
---|---|---|
committer | John Mayhew | 2012-07-24 15:46:16 -0700 |
commit | 9f240b8b9b1f5fb0f145c343ca5e533e25e81374 (patch) | |
tree | 407564eaa6466e8d4cf2eeee0c56dc623243586f /js/clipboard/internal-ops | |
parent | d25359c75089215ee48838db081fd3d51cbbd85f (diff) | |
parent | 21d74af1e9fc57cc25cea8aa7408beabf79ff2f3 (diff) | |
download | ninja-9f240b8b9b1f5fb0f145c343ca5e533e25e81374.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja
Diffstat (limited to 'js/clipboard/internal-ops')
-rw-r--r-- | js/clipboard/internal-ops/elements-clipboard-agent.js | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js index a6bce2ba..cfc75916 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js | |||
@@ -152,8 +152,6 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
152 | 152 | ||
153 | this.pasteCounter++; | 153 | this.pasteCounter++; |
154 | 154 | ||
155 | //cleanse HTML | ||
156 | |||
157 | for(j=0; j< this.copiedObjects.copy.length; j++){ | 155 | for(j=0; j< this.copiedObjects.copy.length; j++){ |
158 | copiedElement = this.copiedObjects.copy[j]; | 156 | copiedElement = this.copiedObjects.copy[j]; |
159 | styles = null; | 157 | styles = null; |
@@ -259,16 +257,13 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
259 | 257 | ||
260 | if(sourceCanvas.ownerDocument.defaultView.getComputedStyle(sourceCanvas).getPropertyValue("position") === "absolute"){ | 258 | if(sourceCanvas.ownerDocument.defaultView.getComputedStyle(sourceCanvas).getPropertyValue("position") === "absolute"){ |
261 | styles = canvas.elementModel.data || {}; | 259 | styles = canvas.elementModel.data || {}; |
262 | styles.top = "" + (this.application.ninja.elementMediator.getProperty(sourceCanvas, "top", parseInt) + (25 * this.pasteCounter))+"px"; | 260 | styles.top = "" + (this.application.ninja.elementMediator.getProperty(sourceCanvas, "top", parseInt) + (10 * this.pasteCounter))+"px"; |
263 | styles.left = "" + (this.application.ninja.elementMediator.getProperty(sourceCanvas, "left", parseInt) + (25 * this.pasteCounter)) + "px"; | 261 | styles.left = "" + (this.application.ninja.elementMediator.getProperty(sourceCanvas, "left", parseInt) + (10 * this.pasteCounter)) + "px"; |
264 | }else{ | 262 | }else{ |
265 | styles = null; | 263 | styles = null; |
266 | } | 264 | } |
267 | 265 | ||
268 | var addDelegate = this.application.ninja.elementMediator.addDelegate; | 266 | this.application.ninja.elementMediator.addElements(canvas, styles, false/*notify*/, false /*callAddDelegate*/); |
269 | this.application.ninja.elementMediator.addDelegate = null; | ||
270 | this.application.ninja.elementMediator.addElements(canvas, styles, false); | ||
271 | this.application.ninja.elementMediator.addDelegate = addDelegate; | ||
272 | 267 | ||
273 | worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null; | 268 | worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null; |
274 | if(worldData) | 269 | if(worldData) |
@@ -360,13 +355,11 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
360 | 355 | ||
361 | x = styles ? ("" + styles.left + "px") : "100px"; | 356 | x = styles ? ("" + styles.left + "px") : "100px"; |
362 | y = styles ? ("" + styles.top + "px") : "100px"; | 357 | y = styles ? ("" + styles.top + "px") : "100px"; |
363 | newX = styles ? ("" + (styles.left + (25 * counter)) + "px") : "100px"; | 358 | newX = styles ? ("" + (styles.left + (10 * counter)) + "px") : "100px"; |
364 | newY = styles ? ("" + (styles.top + (25 * counter)) + "px") : "100px"; | 359 | newY = styles ? ("" + (styles.top + (10 * counter)) + "px") : "100px"; |
365 | 360 | ||
366 | var addDelegate = this.application.ninja.elementMediator.addDelegate; | ||
367 | this.application.ninja.elementMediator.addDelegate = null; | ||
368 | if(!styles || (styles && !styles.position)){ | 361 | if(!styles || (styles && !styles.position)){ |
369 | this.application.ninja.elementMediator.addElements(element, null, false); | 362 | this.application.ninja.elementMediator.addElements(element, null, false /*notify*/, false /*callAddDelegate*/); |
370 | }else if(styles && (styles.position === "absolute")){ | 363 | }else if(styles && (styles.position === "absolute")){ |
371 | if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){ | 364 | if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){ |
372 | element.onload = function(){ | 365 | element.onload = function(){ |
@@ -376,9 +369,8 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
376 | } | 369 | } |
377 | } | 370 | } |
378 | 371 | ||
379 | this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace | 372 | this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false/*notify*/, false /*callAddDelegate*/);//displace |
380 | } | 373 | } |
381 | this.application.ninja.elementMediator.addDelegate = addDelegate; | ||
382 | } | 374 | } |
383 | }, | 375 | }, |
384 | 376 | ||