aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
Diffstat (limited to 'js/components')
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.js4
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.html4
-rwxr-xr-xjs/components/layout/tool-button.reel/tool-button.js11
-rwxr-xr-xjs/components/layout/tools-list.reel/tools-list.html12
-rwxr-xr-xjs/components/radio.reel/radio.html9
-rwxr-xr-xjs/components/radio.reel/radio.js24
-rwxr-xr-xjs/components/ui/color-chip.reel/color-chip.js13
-rwxr-xr-xjs/components/ui/file-input.reel/file-input.js2
-rwxr-xr-xjs/components/ui/input-group.reel/input-group.html3
-rwxr-xr-xjs/components/ui/property-control.reel/property-control.js12
10 files changed, 54 insertions, 40 deletions
diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js
index ad0236c6..50b3624c 100755
--- a/js/components/layout/document-entry.reel/document-entry.js
+++ b/js/components/layout/document-entry.reel/document-entry.js
@@ -121,8 +121,8 @@ exports.DocumentEntry = Montage.create(Component, {
121 if(event._event.target.nodeName === "IMG") { 121 if(event._event.target.nodeName === "IMG") {
122 this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 122 this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid));
123 } else { 123 } else {
124 if(!this._document.isActive) { 124 if(!this.active) {
125 this.application.ninja.stage.stageView.switchDocument(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); 125 this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid));
126 } 126 }
127 } 127 }
128 } 128 }
diff --git a/js/components/layout/tool-button.reel/tool-button.html b/js/components/layout/tool-button.reel/tool-button.html
index 84a6d34e..a329f646 100755
--- a/js/components/layout/tool-button.reel/tool-button.html
+++ b/js/components/layout/tool-button.reel/tool-button.html
@@ -16,6 +16,10 @@
16 "prototype": "js/components/layout/tool-button.reel", 16 "prototype": "js/components/layout/tool-button.reel",
17 "properties": { 17 "properties": {
18 "element": {"#": "toolBarButton"} 18 "element": {"#": "toolBarButton"}
19 },
20 "bindings": {
21 "selected": {"<<->": "@owner.data.selected"},
22 "subselected": {"<-": "@owner.data.subtools.selected"}
19 } 23 }
20 } 24 }
21 } 25 }
diff --git a/js/components/layout/tool-button.reel/tool-button.js b/js/components/layout/tool-button.reel/tool-button.js
index 6cea0dc3..6008c4ec 100755
--- a/js/components/layout/tool-button.reel/tool-button.js
+++ b/js/components/layout/tool-button.reel/tool-button.js
@@ -48,19 +48,8 @@ exports.ToolButton = Montage.create(Component, {
48 this.element.addEventListener("mousedown", this, false); 48 this.element.addEventListener("mousedown", this, false);
49 this.element.addEventListener("dblclick", this, false); 49 this.element.addEventListener("dblclick", this, false);
50 50
51 Object.defineBinding(this, "selected", {
52 boundObject: this.data,
53 boundObjectPropertyPath: "selected",
54 oneway: false
55 });
56
57 if(this.data.container) { 51 if(this.data.container) {
58 this.element.title = this.data.subtools[this._subselected].toolTip; 52 this.element.title = this.data.subtools[this._subselected].toolTip;
59 Object.defineBinding(this, "subselected", {
60 boundObject: this.data.subtools,
61 boundObjectPropertyPath: "selected",
62 oneway: true
63 });
64 } 53 }
65 54
66 this.element.classList.add(this.data.id) 55 this.element.classList.add(this.data.id)
diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html
index d5c33624..df603bf8 100755
--- a/js/components/layout/tools-list.reel/tools-list.html
+++ b/js/components/layout/tools-list.reel/tools-list.html
@@ -16,11 +16,7 @@
16 "element": {"#": "toolbutton"} 16 "element": {"#": "toolbutton"}
17 }, 17 },
18 "bindings": { 18 "bindings": {
19 "data": { 19 "data": {"<-": "@repetition1.objectAtCurrentIteration"}
20 "boundObject": {"@": "repetition1"},
21 "boundObjectPropertyPath": "objectAtCurrentIteration",
22 "oneway": true
23 }
24 } 20 }
25 }, 21 },
26 22
@@ -30,11 +26,7 @@
30 "element": {"#": "groupLine"} 26 "element": {"#": "groupLine"}
31 }, 27 },
32 "bindings": { 28 "bindings": {
33 "condition": { 29 "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"}
34 "boundObject": {"@": "repetition1"},
35 "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup",
36 "oneway": true
37 }
38 } 30 }
39 }, 31 },
40 32
diff --git a/js/components/radio.reel/radio.html b/js/components/radio.reel/radio.html
index 01b76b92..cee4c369 100755
--- a/js/components/radio.reel/radio.html
+++ b/js/components/radio.reel/radio.html
@@ -11,13 +11,18 @@
11 "owner": { 11 "owner": {
12 "prototype": "js/components/radio.reel", 12 "prototype": "js/components/radio.reel",
13 "properties": { 13 "properties": {
14 "element": {"#": "ch_comp"} 14 "element": {"#": "radio_comp"},
15 "labelField": {"#": "labelField"},
16 "radioField": {"#": "radioField"}
15 } 17 }
16 } 18 }
17 } 19 }
18 </script> 20 </script>
19</head> 21</head>
20<body> 22<body>
21 <input data-montage-id="ch_comp" class="nj-skinned" type="radio"> 23 <div data-montage-id="radio_comp">
24 <input data-montage-id="radioField" class="nj-skinned" type="radio">
25 <label data-montage-id="labelField" class="nj-skinned"></label>
26 </div>
22</body> 27</body>
23</html> \ No newline at end of file 28</html> \ No newline at end of file
diff --git a/js/components/radio.reel/radio.js b/js/components/radio.reel/radio.js
index c661ec11..cec4f52e 100755
--- a/js/components/radio.reel/radio.js
+++ b/js/components/radio.reel/radio.js
@@ -62,7 +62,7 @@ exports.RadioGroup = Montage.create(Component, {
62 { 62 {
63 value:function(radio) 63 value:function(radio)
64 { 64 {
65 radio.element.setAttribute("name", this.name); 65 radio.radioField.setAttribute("name", this.name);
66 radio.addEventListener("change", this, false); 66 radio.addEventListener("change", this, false);
67 this.radios.push(radio); 67 this.radios.push(radio);
68 } 68 }
@@ -104,6 +104,14 @@ exports.Radio = Montage.create(Component, {
104 value: null 104 value: null
105 }, 105 },
106 106
107 labelField: {
108 value: null
109 },
110
111 radioField: {
112 value: null
113 },
114
107 _checked: { 115 _checked: {
108 enumerable: false, 116 enumerable: false,
109 value: false 117 value: false
@@ -140,13 +148,13 @@ exports.Radio = Montage.create(Component, {
140 { 148 {
141 this._valueSyncedWithInputField = true; 149 this._valueSyncedWithInputField = true;
142 this._wasSetByCode = false; 150 this._wasSetByCode = false;
143 this.checked = this.element.checked; 151 this.checked = this.radioField.checked;
144 } 152 }
145 }, 153 },
146 handleClick: { 154 handleClick: {
147 value: function() { 155 value: function() {
148 this._wasSetByCode = false; 156 this._wasSetByCode = false;
149 this.checked = !this.element.checked; 157 this.checked = !this.radioField.checked;
150 } 158 }
151 }, 159 },
152 160
@@ -154,7 +162,7 @@ exports.Radio = Montage.create(Component, {
154 value: function() { 162 value: function() {
155 if(!this._valueSyncedWithInputField) 163 if(!this._valueSyncedWithInputField)
156 { 164 {
157 this.element.checked = this._checked; 165 this.radioField.checked = this._checked;
158 } 166 }
159 this._valueSyncedWithInputField = false; 167 this._valueSyncedWithInputField = false;
160 } 168 }
@@ -163,15 +171,13 @@ exports.Radio = Montage.create(Component, {
163 prepareForDraw: { 171 prepareForDraw: {
164 value: function() { 172 value: function() {
165 if (this.label !== null) { 173 if (this.label !== null) {
166 var b = document.createElement("label"); 174 this.labelField.innerHTML = this.label;
167 b.innerHTML = this.label;
168 this.element.appendChild(b);
169 b.addEventListener("click", this, false);
170 } 175 }
176 this.element.addEventListener("click", this, false);
171 if (this.group !== null) { 177 if (this.group !== null) {
172 this.group.addRadio(this); 178 this.group.addRadio(this);
173 } 179 }
174 this.element.addEventListener("change", this, false); 180 this.radioField.addEventListener("change", this, false);
175 } 181 }
176 } 182 }
177 183
diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js
index 4e64b2e8..630dcd4b 100755
--- a/js/components/ui/color-chip.reel/color-chip.js
+++ b/js/components/ui/color-chip.reel/color-chip.js
@@ -33,6 +33,11 @@ var ColorChip = exports.ColorChip = Montage.create(Component, {
33 value: {r:0, g:0, b:0, a:1, css:'rgb(0,0,0)', mode:'rgb'} 33 value: {r:0, g:0, b:0, a:1, css:'rgb(0,0,0)', mode:'rgb'}
34 }, 34 },
35 35