diff options
author | hwc487 | 2012-03-16 12:40:50 -0700 |
---|---|---|
committer | hwc487 | 2012-03-16 12:40:50 -0700 |
commit | 2ac5db3bb1bcee887d6dd742e6c0273abb5366bd (patch) | |
tree | 13622390967922f9c1719bf835f2f818867b5b9b /js/components | |
parent | a0d23354802ebc6b437698acb4b18d3395d47cd1 (diff) | |
parent | 3e98d9eaf6f691aa0f7a4334983537a4ee3ffd39 (diff) | |
download | ninja-2ac5db3bb1bcee887d6dd742e6c0273abb5366bd.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
Diffstat (limited to 'js/components')
15 files changed, 277 insertions, 39 deletions
diff --git a/js/components/focus-manager.reel/focus-manager.js b/js/components/focus-manager.reel/focus-manager.js new file mode 100644 index 00000000..65a84bc1 --- /dev/null +++ b/js/components/focus-manager.reel/focus-manager.js | |||
@@ -0,0 +1,49 @@ | |||
1 | /* <copyright> | ||
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/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.FocusManager = Montage.create(Component, { | ||
11 | |||
12 | hasTemplate: { | ||
13 | value: false | ||
14 | }, | ||
15 | |||
16 | element: { | ||
17 | serializable: true, | ||
18 | enumerable: true, | ||
19 | get: function() { | ||
20 | return this._element; | ||
21 | }, | ||
22 | set: function(value) { | ||
23 | // call super set | ||
24 | Object.getPropertyDescriptor(Component, "element").set.call(this, value); | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | hiddenInput: { | ||
29 | value: null | ||
30 | }, | ||
31 | |||
32 | prepareForDraw: { | ||
33 | value: function() { | ||
34 | this.hiddenInput = document.createElement("input"); | ||
35 | this.hiddenInput.type = "text"; | ||
36 | |||
37 | this.element.appendChild(this.hiddenInput); | ||
38 | |||
39 | } | ||
40 | }, | ||
41 | |||
42 | setFocus: { | ||
43 | value: function() { | ||
44 | this.hiddenInput.focus(); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | }); | ||
49 | |||
diff --git a/js/components/gradientpicker.reel/gradientpicker.js b/js/components/gradientpicker.reel/gradientpicker.js index da4e8c0f..b10f6624 100755 --- a/js/components/gradientpicker.reel/gradientpicker.js +++ b/js/components/gradientpicker.reel/gradientpicker.js | |||
@@ -213,21 +213,13 @@ exports.GradientPicker = Montage.create(Component, { | |||
213 | removeStop: { | 213 | removeStop: { |
214 | enumerable: false, | 214 | enumerable: false, |
215 | value: function(stop) { | 215 | value: function(stop) { |
216 | //Removing stops | ||
217 | this.element._components.stopsContainer.removeChild(stop); | ||
218 | //Stopping events related to this current stop | ||
219 | this.removeStopMoving(); | ||
220 | //Resetting stops if less than 2 | ||
221 | var i, buttons = this.element._components.stopsContainer.getElementsByTagName('button'); | 216 | var i, buttons = this.element._components.stopsContainer.getElementsByTagName('button'); |
222 | if (buttons.length < 2) { | 217 | // |
223 | //Removing remaining stops prior to resetting | 218 | if (buttons.length > 2) { |
224 | for (i=0; buttons[i]; i++) { | 219 | //Removing stops |
225 | this.element._components.stopsContainer.removeChild(buttons[i].stop); | 220 | this.element._components.stopsContainer.removeChild(stop); |
226 | } | 221 | //Stopping events related to this current stop |
227 | //Nulling then adding defaults | 222 | this.removeStopMoving(); |
228 | this.value = null; | ||
229 | this.addDefaultStops(); | ||
230 | this._dispatchEvent('change', false); | ||
231 | } | 223 | } |
232 | } | 224 | } |
233 | }, | 225 | }, |
@@ -327,7 +319,7 @@ exports.GradientPicker = Montage.create(Component, { | |||
327 | // | 319 | // |
328 | this.application.ninja.colorController.colorPopupManager.hideColorChipPopup(); | 320 | this.application.ninja.colorController.colorPopupManager.hideColorChipPopup(); |
329 | // | 321 | // |
330 | if ((e._event.y+this.hack.y) > this.element._trackY+50 || (e._event.y+this.hack.y) < this.element._trackY) { | 322 | if ((e._event.y+this.hack.y) > this.element._trackY+70 || (e._event.y+this.hack.y) < this.element._trackY) { |
331 | this.removeStop(this.currentStop); | 323 | this.removeStop(this.currentStop); |
332 | } | 324 | } |
333 | // | 325 | // |
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css index 67497e10..dcfd471c 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.css +++ b/js/components/layout/bread-crumb.reel/bread-crumb.css | |||
@@ -8,7 +8,7 @@ | |||
8 | background-color: #282828; | 8 | background-color: #282828; |
9 | border-style: double; | 9 | border-style: double; |
10 | height: 26px; | 10 | height: 26px; |
11 | 11 | position:relative; | |
12 | -webkit-box-flex: 0; | 12 | -webkit-box-flex: 0; |
13 | } | 13 | } |
14 | 14 | ||
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index f2368e9a..413f588d 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html | |||
@@ -60,6 +60,20 @@ | |||
60 | "oneway": true | 60 | "oneway": true |
61 | } | 61 | } |
62 | } | 62 | } |
63 | }, | ||
64 | |||
65 | "disable": { | ||
66 | "prototype": "montage/ui/condition.reel", | ||
67 | "properties": { | ||
68 | "element": {"#": "disabledCondition"} | ||
69 | }, | ||
70 | "bindings": { | ||
71 | "condition": { | ||
72 | "boundObject": {"@": "owner"}, | ||
73 | "boundObjectPropertyPath": "disabled", | ||
74 | "oneway": true | ||
75 | } | ||
76 | } | ||
63 | } | 77 | } |
64 | } | 78 | } |
65 | </script> | 79 | </script> |
@@ -71,6 +85,7 @@ | |||
71 | <div id="breadcrumb_container"> | 85 | <div id="breadcrumb_container"> |
72 | <button id="breadcrumb_button" class="nj-skinned"></button> | 86 | <button id="breadcrumb_button" class="nj-skinned"></button> |
73 | </div> | 87 | </div> |
88 | <div id="disabledCondition" class="panelDisabled"></div> | ||
74 | </section> | 89 | </section> |
75 | 90 | ||
76 | </body> | 91 | </body> |
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index b2fa42b1..f35972b6 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js | |||
@@ -9,6 +9,24 @@ var Montage = require("montage/core/core").Montage, | |||
9 | 9 | ||
10 | exports.Breadcrumb = Montage.create(Component, { | 10 | exports.Breadcrumb = Montage.create(Component, { |
11 | 11 | ||
12 | disabled: { | ||
13 | value: true | ||
14 | }, | ||
15 | |||
16 | handleOpenDocument: { | ||
17 | value: function(){ | ||
18 | this.disabled = false; | ||
19 | } | ||
20 | }, | ||
21 | |||
22 | handleCloseDocument: { | ||
23 | value: function(){ | ||
24 | if(!this.application.ninja.documentController.activeDocument) { | ||
25 | this.disabled = true; | ||
26 | } | ||
27 | } | ||
28 | }, | ||
29 | |||
12 | _container:{ | 30 | _container:{ |
13 | value:null | 31 | value:null |
14 | }, | 32 | }, |
@@ -31,6 +49,8 @@ exports.Breadcrumb = Montage.create(Component, { | |||
31 | 49 | ||
32 | prepareForDraw: { | 50 | prepareForDraw: { |
33 | value: function() { | 51 | value: function() { |
52 | this.eventManager.addEventListener("openDocument", this, false); | ||
53 | this.eventManager.addEventListener("closeDocument", this, false); | ||
34 | this.breadcrumbBt.addEventListener("action", this, false); | 54 | this.breadcrumbBt.addEventListener("action", this, false); |
35 | } | 55 | } |
36 | }, | 56 | }, |
@@ -51,8 +71,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
51 | // This is always the top container which is now hardcoded to body | 71 | // This is always the top container which is now hardcoded to body |
52 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); | 72 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); |
53 | 73 | ||
54 | // This is for the timeline -- Disable it since the timeline should not know about this object | 74 | |
55 | // NJevent('layerBinding',{selected:false ,element:this.container}) | ||