aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorArmen Kesablyan2012-02-13 11:59:19 -0800
committerArmen Kesablyan2012-02-13 11:59:19 -0800
commit90d0c8c0e98d062c628c061fe5765ce991fda409 (patch)
tree9780e9dcf475bf319f3cacc1a1ad52fcf9f133af /js/mediators
parent8110e01dc5093ac6baf621103dcaa5f769e5be92 (diff)
parente142611e22718b1f1d1696902ad9161ec5f33f98 (diff)
downloadninja-90d0c8c0e98d062c628c061fe5765ce991fda409.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Conflicts: css/ninja.css js/stage/stage.reel/stage.html js/tools/TextTool.js node_modules/labs/rich-text-editor.reel/rich-text-editor.css node_modules/labs/rich-text-editor.reel/rich-text-editor.html node_modules/labs/rich-text-editor.reel/rich-text-editor.js node_modules/labs/rich-text-editor.reel/rich-text-resizer.js node_modules/labs/rich-text-editor.reel/rich-text-sanitizer.js Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/mediators')
-rw-r--r--js/mediators/drag-drop-mediator.js2
-rw-r--r--js/mediators/element-mediator.js26
2 files changed, 27 insertions, 1 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js
index aacb228c..ede71383 100644
--- a/js/mediators/drag-drop-mediator.js
+++ b/js/mediators/drag-drop-mediator.js
@@ -122,7 +122,7 @@ exports.DragDropMediator = Montage.create(Component, {
122 122
123 NJUtils.makeElementModel(domElem, "SVG", "block"); 123 NJUtils.makeElementModel(domElem, "SVG", "block");
124 } else { // treat as a regular image 124 } else { // treat as a regular image
125 domElem = NJUtils.makeNJElement("image", "Image", "block"); 125 domElem = NJUtils.makeNJElement("image", "image", "image");
126 domElem.src = evt2.currentTarget.result; 126 domElem.src = evt2.currentTarget.result;
127 } 127 }
128 128
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js
index c44e1cb5..95aec2a3 100644
--- a/js/mediators/element-mediator.js
+++ b/js/mediators/element-mediator.js
@@ -105,6 +105,25 @@ exports.ElementMediator = Montage.create(NJComponent, {
105 } 105 }
106 }, 106 },
107 107
108 deleteElements: {
109 value: function(items) {
110 // Add the Undo/Redo
111 var len, el;
112
113 len = items.length;
114
115 if(len) {
116
117 for(var i = len - 1; i >= 0; i--) {
118 el = items[i]._element || items[i];
119 this._removeElement(el);
120 }
121
122 NJevent( "deleteSelection", items );
123 }
124 }
125 },
126
108 _removeElement: { 127 _removeElement: {
109 value: function(el, rules) { 128 value: function(el, rules) {
110 ElementController.removeElement(el, rules); 129 ElementController.removeElement(el, rules);
@@ -112,6 +131,13 @@ exports.ElementMediator = Montage.create(NJComponent, {
112 } 131 }
113 }, 132 },
114 133
134 replaceElement: {
135 value: function(el, el2) {
136 el2.elementModel = el.elementModel;
137 this.application.ninja.currentDocument.documentRoot.replaceChild(el2, el);
138 }
139 },
140
115 getNJProperty: { 141 getNJProperty: {
116 value: function(el, p) { 142 value: function(el, p) {
117 if(el.elementModel) { 143 if(el.elementModel) {