diff options
author | Ananya Sen | 2012-06-21 11:07:11 -0700 |
---|---|---|
committer | Ananya Sen | 2012-06-21 11:07:11 -0700 |
commit | 6915d6607f2d768f363baed84287f6593925ae1e (patch) | |
tree | 306738165c11fab764a27c3e76d93c2e4d86f297 /js | |
parent | 8db9e73ca68c006769af3997034959f6b7008add (diff) | |
parent | c8fc6d15e1570e89243abe527cd149e354f7e11f (diff) | |
download | ninja-6915d6607f2d768f363baed84287f6593925ae1e.tar.gz |
Merge branch 'refs/heads/ninja-internal-master' into cut-copy-paste
Diffstat (limited to 'js')
39 files changed, 4249 insertions, 1598 deletions
diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js index 803770db..08e87bf0 100644 --- a/js/components/hintable.reel/hintable.js +++ b/js/components/hintable.reel/hintable.js | |||
@@ -146,7 +146,11 @@ exports.Hintable = Montage.create(Editable, { | |||
146 | }, | 146 | }, |
147 | set: function(str) { | 147 | set: function(str) { |
148 | var node = this._getFirstTextNode(); | 148 | var node = this._getFirstTextNode(); |
149 | node.textContent = str; | 149 | if (node.textContent !== str) { |
150 | node.textContent = str; | ||
151 | } | ||
152 | |||
153 | //node.innerText = str; | ||
150 | } | 154 | } |
151 | }, | 155 | }, |
152 | 156 | ||
@@ -331,4 +335,4 @@ exports.Hintable = Montage.create(Editable, { | |||
331 | distinct: true | 335 | distinct: true |
332 | } | 336 | } |
333 | 337 | ||
334 | }); \ No newline at end of file | 338 | }); |
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index e40a646a..1e05b09b 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -15,19 +15,19 @@ exports.ElementController = Montage.create(Component, { | |||
15 | 15 | ||
16 | if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); | 16 | if (el.getAttribute) el.setAttribute('data-ninja-node', 'true'); |
17 | 17 | ||
18 | if(this.application.ninja.timeline.currentLayerSelected) { | 18 | // Updated to use new methods in TimelinePanel. JR. |
19 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); | 19 | var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); |
20 | 20 | if (insertionIndex === false) { | |
21 | if(selectedLayerIndex === 0) { | 21 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
22 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); | 22 | } else { |
23 | } else { | 23 | if (insertionIndex === 0) { |
24 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; | 24 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); |
25 | } else { | ||
26 | var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; | ||
25 | element.parentNode.insertBefore(el, element.nextSibling); | 27 | element.parentNode.insertBefore(el, element.nextSibling); |
26 | } | 28 | } |
27 | } else { | 29 | } |
28 | this.application.ninja.currentDocument.model.domContainer.appendChild(el); | 30 | |
29 | } | ||
30 | |||
31 | if(styles) { | 31 | if(styles) { |
32 | this.application.ninja.stylesController.setElementStyles(el, styles); | 32 | this.application.ninja.stylesController.setElementStyles(el, styles); |
33 | } | 33 | } |
@@ -83,24 +83,24 @@ exports.ElementController = Montage.create(Component, { | |||
83 | 83 | ||
84 | // Return cached value if one exists | 84 | // Return cached value if one exists |
85 | if(isFill) { | 85 | if(isFill) { |
86 | if(el.elementModel.fill) { | 86 | // if(el.elementModel.fill) { |
87 | return el.elementModel.fill; | 87 | // return el.elementModel.fill; |
88 | } | 88 | // } |
89 | //TODO: Once logic for color and gradient is established, this needs to be revised | 89 | //TODO: Once logic for color and gradient is established, this needs to be revised |
90 | color = this.getProperty(el, "background-color"); | 90 | color = this.getProperty(el, "background-color"); |
91 | image = this.getProperty(el, "background-image"); | 91 | image = this.getProperty(el, "background-image"); |
92 | } else { | 92 | } else { |
93 | // Try getting border color from specific side first | 93 | // Try getting border color from specific side first |
94 | if(borderSide) { | 94 | if(borderSide) { |
95 | color = this.getProperty(el, "border-" + borderSide + "-color"); | 95 | color = this.getProperty(el, "border-" + borderSide + "-color",true); |
96 | image = this.getProperty(el, "border-" + borderSide + "-image"); | 96 | image = this.getProperty(el, "border-" + borderSide + "-image"); |
97 | } | 97 | } |
98 | 98 | ||
99 | // If no color was found, look up the shared border color | 99 | // If no color was found, look up the shared border color |
100 | if(!color && !image) { | 100 | if(!color && !image) { |
101 | if(el.elementModel.stroke) { | 101 | // if(el.elementModel.stroke) { |
102 | return el.elementModel.stroke; | 102 | // return el.elementModel.stroke; |
103 | } | 103 | // } |
104 | 104 | ||
105 | color = this.getProperty(el, "border-color"); | 105 | color = this.getProperty(el, "border-color"); |
106 | image = this.getProperty(el, "border-image"); | 106 | image = this.getProperty(el, "border-image"); |
@@ -132,7 +132,7 @@ exports.ElementController = Montage.create(Component, { | |||
132 | }, | 132 | }, |
133 | 133 | ||
134 | setColor: { | 134 | setColor: { |
135 | value: function(el, color, isFill) { | 135 | value: function(el, color, isFill,borderSide) { |
136 | var mode = color.mode; | 136 | var mode = color.mode; |
137 | 137 | ||
138 | if(isFill) { | 138 | if(isFill) { |
diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index 017ed20a..ca7aadaf 100755 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js | |||
@@ -1,42 +1,42 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> |
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | var ElementController = require("js/controllers/elements/element-controller").ElementController, | 10 | var ElementController = require("js/controllers/elements/element-controller").ElementController, |
11 | Command = require("js/controllers/undo-controller").Command, | 11 | Command = require("js/controllers/undo-controller").Command, |
12 | NJUtils = require("js/lib/NJUtils").NJUtils; | 12 | NJUtils = require("js/lib/NJUtils").NJUtils; |
13 | 13 | ||
14 | exports.ElementMediator = Montage.create(Component, { | 14 | exports.ElementMediator = Montage.create(Component, { |
15 | 15 | ||
16 | addDelegate: { | 16 | addDelegate:{ |
17 | enumerable: false, | 17 | enumerable:false, |
18 | value: null | 18 | value:null |
19 | }, | 19 | }, |
20 | 20 | ||
21 | deleteDelegate: { | 21 | deleteDelegate:{ |
22 | enumerable: false, | 22 | enumerable:false, |
23 | value: null | 23 | value:null |
24 | }, | 24 | }, |
25 | 25 | ||
26 | addElements: { | 26 | addElements:{ |
27 | value: function(elements, rules, notify) { | 27 | value:function (elements, rules, notify) { |
28 | if(Array.isArray(elements)) { |