From a396caf12a9e1fc84b984d39f8e671c335d2f5d5 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 14:36:53 -0700 Subject: File Input control in materials panel was not working because of the change from id to data-montage-id. Signed-off-by: Nivesh Rajbhandari --- js/components/ui/file-input.reel/file-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/ui/file-input.reel/file-input.js b/js/components/ui/file-input.reel/file-input.js index b57f7c21..584380ec 100755 --- a/js/components/ui/file-input.reel/file-input.js +++ b/js/components/ui/file-input.reel/file-input.js @@ -38,7 +38,7 @@ var FileInput = exports.FileInput = Montage.create(Component, { { value:function(event) { - if(event.currentTarget.id === "fileInputControl") + if(event.currentTarget.type === "file") { this.filePath = this.inputField.value; } -- cgit v1.2.3 From 3e22b0940bb7752e292e485d8a393f215cae05de Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 15:14:36 -0700 Subject: Fixed Materials Popup to work with new changes to repetition bindings. Signed-off-by: Nivesh Rajbhandari --- js/components/ui/input-group.reel/input-group.html | 3 ++- js/components/ui/property-control.reel/property-control.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'js/components') diff --git a/js/components/ui/input-group.reel/input-group.html b/js/components/ui/input-group.reel/input-group.html index ba85c089..7da4a855 100755 --- a/js/components/ui/input-group.reel/input-group.html +++ b/js/components/ui/input-group.reel/input-group.html @@ -25,7 +25,8 @@ "bindings": { "data": { "boundObject": {"@": "propList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration" + "boundObjectPropertyPath": "objectAtCurrentIteration", + "oneway": true } }, "listeners": [ diff --git a/js/components/ui/property-control.reel/property-control.js b/js/components/ui/property-control.reel/property-control.js index c28979a9..20ec173e 100755 --- a/js/components/ui/property-control.reel/property-control.js +++ b/js/components/ui/property-control.reel/property-control.js @@ -120,8 +120,13 @@ var PropertyControl = exports.PropertyControl = Montage.create(Component, { set: function (data) { if (data !== this._data) { this._data = data; - this.label = data.label; - this.controlType = data.controlType; + if(data) { + this._label = data.label; + this._controlType = data.controlType; + } else { + this._label = ""; + this._controlType = null; + } this.needsDraw = true; } } @@ -143,6 +148,9 @@ var PropertyControl = exports.PropertyControl = Montage.create(Component, { { value:function(event) { + if(event.wasSetByCode) { + return; + } this._dispatchPropEvent(event); } }, -- cgit v1.2.3 From ca70f18a62a2a2b5670be132361e3a3f5907d920 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 18 May 2012 17:12:37 -0700 Subject: Fixing radio control in the PI. Signed-off-by: Nivesh Rajbhandari --- js/components/radio.reel/radio.html | 9 +++++++-- js/components/radio.reel/radio.js | 24 +++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) (limited to 'js/components') 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 @@ "owner": { "prototype": "js/components/radio.reel", "properties": { - "element": {"#": "ch_comp"} + "element": {"#": "radio_comp"}, + "labelField": {"#": "labelField"}, + "radioField": {"#": "radioField"} } } } - +
+ + +
\ 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, { { value:function(radio) { - radio.element.setAttribute("name", this.name); + radio.radioField.setAttribute("name", this.name); radio.addEventListener("change", this, false); this.radios.push(radio); } @@ -104,6 +104,14 @@ exports.Radio = Montage.create(Component, { value: null }, + labelField: { + value: null + }, + + radioField: { + value: null + }, + _checked: { enumerable: false, value: false @@ -140,13 +148,13 @@ exports.Radio = Montage.create(Component, { { this._valueSyncedWithInputField = true; this._wasSetByCode = false; - this.checked = this.element.checked; + this.checked = this.radioField.checked; } }, handleClick: { value: function() { this._wasSetByCode = false; - this.checked = !this.element.checked; + this.checked = !this.radioField.checked; } }, @@ -154,7 +162,7 @@ exports.Radio = Montage.create(Component, { value: function() { if(!this._valueSyncedWithInputField) { - this.element.checked = this._checked; + this.radioField.checked = this._checked; } this._valueSyncedWithInputField = false; } @@ -163,15 +171,13 @@ exports.Radio = Montage.create(Component, { prepareForDraw: { value: function() { if (this.label !== null) { - var b = document.createElement("label"); - b.innerHTML = this.label; - this.element.appendChild(b); - b.addEventListener("click", this, false); + this.labelField.innerHTML = this.label; } + this.element.addEventListener("click", this, false); if (this.group !== null) { this.group.addRadio(this); } - this.element.addEventListener("change", this, false); + this.radioField.addEventListener("change", this, false); } } -- cgit v1.2.3