diff options
author | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
commit | 6c8f3525b839e82cf43df43700a0160ee2c5458f (patch) | |
tree | 3fb801fa54b759c5568d75bb467e02652ce77c3e /js/components/ui | |
parent | e8ae5db7ce7023b638375cbc27a3f7b7a2f77b23 (diff) | |
parent | 342c97ac9b727b22a7b0bfefca4d2a168bc3055b (diff) | |
download | ninja-6c8f3525b839e82cf43df43700a0160ee2c5458f.tar.gz |
Merge branch 'refs/heads/dom-architecture' into binding
Conflicts:
css/ninja.css
scss/imports/scss/_toolbar.scss
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/components/ui')
5 files changed, 151 insertions, 11 deletions
diff --git a/js/components/ui/color-chip.reel/color-chip.css b/js/components/ui/color-chip.reel/color-chip.css index da75c41e..7c7135a2 100755 --- a/js/components/ui/color-chip.reel/color-chip.css +++ b/js/components/ui/color-chip.reel/color-chip.css | |||
@@ -19,13 +19,3 @@ | |||
19 | padding: 0; | 19 | padding: 0; |
20 | background: none; | 20 | background: none; |
21 | } | 21 | } |
22 | |||
23 | .colortoolbar .chipContainer { | ||
24 | margin: 1px 1px 1px 1px !important; | ||
25 | width: 40px !important; | ||
26 | height: 20px !important; | ||
27 | border: 0; | ||
28 | padding: 0; | ||
29 | background-image: url(../../../../images/colorpanel/transparent.png) !important; | ||
30 | background-repeat: repeat !important; | ||
31 | } \ No newline at end of file | ||
diff --git a/js/components/ui/label-checkbox.reel/label-checkbox.css b/js/components/ui/label-checkbox.reel/label-checkbox.css new file mode 100644 index 00000000..6eb75a0e --- /dev/null +++ b/js/components/ui/label-checkbox.reel/label-checkbox.css | |||
@@ -0,0 +1,9 @@ | |||
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 | .label-checkbox { | ||
8 | display: inline-block; | ||
9 | } \ No newline at end of file | ||
diff --git a/js/components/ui/label-checkbox.reel/label-checkbox.html b/js/components/ui/label-checkbox.reel/label-checkbox.html new file mode 100755 index 00000000..0efc7ae0 --- /dev/null +++ b/js/components/ui/label-checkbox.reel/label-checkbox.html | |||
@@ -0,0 +1,54 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <link rel="stylesheet" href="label-checkbox.css" /> | ||
10 | <script type="text/montage-serialization"> | ||
11 | { | ||
12 | "owner": { | ||
13 | "prototype": "js/components/ui/label-checkbox.reel", | ||
14 | "properties": { | ||
15 | "element": {"#": "labelCheckbox"}, | ||
16 | |||
17 | "_checkbox": {"@": "checkbox"}, | ||
18 | "_labelText": {"@": "labelText"} | ||
19 | } | ||
20 | }, | ||
21 | |||
22 | "checkbox": { | ||
23 | "prototype": "montage/ui/checkbox.reel", | ||
24 | "properties": { | ||
25 | "element": {"#": "checkbox"}, | ||
26 | "checked": false | ||
27 | }, | ||
28 | "listeners": [ | ||
29 | { | ||
30 | "type": "action", | ||
31 | "listener": {"@": "owner"}, | ||
32 | "capture": false | ||
33 | } | ||
34 | ] | ||
35 | }, | ||
36 | |||
37 | "labelText": { | ||
38 | "prototype": "montage/ui/dynamic-text.reel", | ||
39 | "properties": { | ||
40 | "element": {"#": "label"} | ||
41 | } | ||
42 | } | ||
43 | } | ||
44 | </script> | ||
45 | </head> | ||
46 | <body> | ||
47 | <!--<span data-montage-id="labelCheckbox" class="labelCheckbox">--> | ||
48 | <label data-montage-id="labelCheckbox" class="label-checkbox"> | ||
49 | <input data-montage-id="checkbox" class="nj-skinned" type="checkbox"> | ||
50 | <span data-montage-id="label" class="checkbox-label"></span> | ||
51 | </label> | ||
52 | <!--</span>--> | ||
53 | </body> | ||
54 | </html> \ No newline at end of file | ||
diff --git a/js/components/ui/label-checkbox.reel/label-checkbox.js b/js/components/ui/label-checkbox.reel/label-checkbox.js new file mode 100755 index 00000000..21b72cb5 --- /dev/null +++ b/js/components/ui/label-checkbox.reel/label-checkbox.js | |||
@@ -0,0 +1,87 @@ | |||
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 | var Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.LabelCheckbox = Montage.create(Component, { | ||
11 | |||
12 | _label: { | ||
13 | value: "" | ||
14 | }, | ||
15 | |||
16 | label: { | ||
17 | get: function() { | ||
18 | return this._label; | ||
19 | }, | ||
20 | set: function(value) { | ||
21 | if(this._label !== value) { | ||
22 | this._label = value; | ||
23 | this.needsDraw = true; | ||
24 | } | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | _checked: { | ||
29 | value: false | ||
30 | }, | ||
31 | |||
32 | checked: { | ||
33 | serializable: true, | ||
34 | get: function() { | ||
35 | return this._checked; | ||
36 | }, | ||
37 | set: function(value) { | ||
38 | if(this._checked !== value) { | ||
39 | this._checked = value; | ||
40 | this.needsDraw = true; | ||
41 | } | ||
42 | } | ||
43 | }, | ||
44 | |||
45 | _enabled: { | ||
46 | enumerable: false, | ||
47 | value: true | ||
48 | }, | ||
49 | |||
50 | enabled: { | ||
51 | enumerable: true, | ||
52 | serializable: true, | ||
53 | get: function() { | ||
54 | return this._enabled; | ||
55 | }, | ||
56 | set: function(value) { | ||
57 | if(value !== this._enabled) { | ||
58 | this._enabled = value; | ||
59 | this.needsDraw = true; | ||
60 | } | ||
61 | } | ||
62 | }, | ||
63 | |||
64 | value: { | ||
65 | value: false | ||
66 | }, | ||
67 | |||
68 | handleAction: { | ||
69 | value: function(event) { | ||
70 | var e = document.createEvent("CustomEvent"); | ||
71 | e.initEvent("change", true, true); | ||
72 | e.type = "change"; | ||
73 | e.wasSetByCode = false; | ||
74 | this.checked = this.value = e.value = this._checkbox.checked; | ||
75 | this.dispatchEvent(e); | ||
76 | } | ||
77 | }, | ||
78 | |||
79 | draw: { | ||
80 | value: function() { | ||
81 | this._labelText.value = this.label; | ||
82 | this._checkbox.checked = this.checked; | ||
83 | this._checkbox.disabled = !this._enabled; | ||
84 | } | ||
85 | |||
86 | } | ||
87 | }); \ No newline at end of file | ||
diff --git a/js/components/ui/property-control.reel/property-control.js b/js/components/ui/property-control.reel/property-control.js index cd59c02c..c28979a9 100755 --- a/js/components/ui/property-control.reel/property-control.js +++ b/js/components/ui/property-control.reel/property-control.js | |||
@@ -10,7 +10,7 @@ var Montage = require("montage/core/core").Montage, | |||
10 | HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, | 10 | HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, |
11 | Slider = require("js/components/slider.reel").Slider, | 11 | Slider = require("js/components/slider.reel").Slider, |
12 | Button = require("montage/ui/button.reel").Button, | 12 | Button = require("montage/ui/button.reel").Button, |
13 | Checkbox = require("js/components/checkbox.reel").Checkbox, | 13 | Checkbox = require("js/components/ui/label-checkbox.reel").LabelCheckbox, |
14 | Combobox = require("js/components/combobox.reel").Combobox, | 14 | Combobox = require("js/components/combobox.reel").Combobox, |
15 | TextField = require("js/components/TextField.reel").TextField, | 15 | TextField = require("js/components/TextField.reel").TextField, |
16 | ColorChip = require("js/components/ui/color-chip.reel").ColorChip, | 16 | ColorChip = require("js/components/ui/color-chip.reel").ColorChip, |