From ce8fdcdb864c552d0d18c0fb5a1b03bc36522b43 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 1 May 2012 15:41:08 -0700 Subject: Fixing bindings to new model --- js/components/layout/documents-tab.reel/documents-tab.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/components') diff --git a/js/components/layout/documents-tab.reel/documents-tab.html b/js/components/layout/documents-tab.reel/documents-tab.html index 1516a8ce..a2070471 100755 --- a/js/components/layout/documents-tab.reel/documents-tab.html +++ b/js/components/layout/documents-tab.reel/documents-tab.html @@ -33,17 +33,17 @@ }, "name": { "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.name", + "boundObjectPropertyPath": "objectAtCurrentIteration.model.file.name", "oneway": true }, "saveFlag": { "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.needsSave", + "boundObjectPropertyPath": "objectAtCurrentIteration.model.needsSave", "oneway": true }, "active": { "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.isActive", + "boundObjectPropertyPath": "objectAtCurrentIteration.model.isActive", "oneway": true } } -- cgit v1.2.3 From f6f722feecf88c8afe59327eaf8557ce4012abc7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 22:40:02 -0700 Subject: Fixing the dirty document flag. Disabling the stylesheets dirty flag because === true on document open. Signed-off-by: Valerio Virgillito --- .../layout/documents-tab.reel/documents-tab.html | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'js/components') diff --git a/js/components/layout/documents-tab.reel/documents-tab.html b/js/components/layout/documents-tab.reel/documents-tab.html index cf3dbbf5..304c8871 100755 --- a/js/components/layout/documents-tab.reel/documents-tab.html +++ b/js/components/layout/documents-tab.reel/documents-tab.html @@ -26,26 +26,10 @@ "element": {"#": "document"} }, "bindings": { - "document": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - }, - "name": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.file.name", - "oneway": true - }, - "saveFlag": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.needsSave", - "oneway": true - }, - "active": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.model.isActive", - "oneway": true - } + "document": {"<-": "@repetition1.objectAtCurrentIteration"}, + "name": {"<-": "@repetition1.objectAtCurrentIteration.model.file.name"}, + "saveFlag": {"<-": "@repetition1.objectAtCurrentIteration.model.needsSave"}, + "active": {"<-": "@repetition1.objectAtCurrentIteration.model.isActive"} } }, -- cgit v1.2.3 From 2b718df00eb9f3a3d2ad269fab533967668988bf Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 11 May 2012 14:59:59 -0700 Subject: adding a converter for the hot text Signed-off-by: Valerio Virgillito --- js/components/converter/value-units-converter.js | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 js/components/converter/value-units-converter.js (limited to 'js/components') diff --git a/js/components/converter/value-units-converter.js b/js/components/converter/value-units-converter.js new file mode 100644 index 00000000..e4f9aee9 --- /dev/null +++ b/js/components/converter/value-units-converter.js @@ -0,0 +1,29 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage").Montage, +Converter = require("montage/core/converter/converter").Converter; + +exports.ValueUnitsConverter = Montage.create(Converter, { + + // convert fahrenheit to celsius (showing our non-metric heritage here) + convert: { + value: function(value) { +// return (parseInt(value, 10) - 32) / 1.8; +// console.log(value); + console.log(value); + return parseInt(value); + } + }, + + // revert celsius to fahrenheit + revert: { + value: function(value) { +// return (1.8 * parseInt(value, 10)) + 32; + console.log(value); + } + } + +}); -- cgit v1.2.3 From ba5b8238784a41099d0eb76795de2a7e5abde226 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 14 May 2012 13:44:27 -0700 Subject: code cleanup Signed-off-by: Valerio Virgillito --- js/components/layout/document-entry.reel/document-entry.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/components') diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index 9e4110e2..81a63c90 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -7,8 +7,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage; var Component = require("montage/ui/component").Component; -//var documentManagerModule = ("js/document/documentManager"); - exports.DocumentEntry = Montage.create(Component, { dirty: { value: null }, -- cgit v1.2.3 From 7f71c29e6558eefc5904ca0dfcb7ec898b2492a5 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 14 May 2012 16:04:37 -0700 Subject: adding some test converters Signed-off-by: Valerio Virgillito --- js/components/converter/string-units-converter.js | 31 +++++++++++++++++++++++ js/components/converter/string-value-converter.js | 29 +++++++++++++++++++++ js/components/converter/value-units-converter.js | 29 --------------------- 3 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 js/components/converter/string-units-converter.js create mode 100644 js/components/converter/string-value-converter.js delete mode 100644 js/components/converter/value-units-converter.js (limited to 'js/components') diff --git a/js/components/converter/string-units-converter.js b/js/components/converter/string-units-converter.js new file mode 100644 index 00000000..6b97d5c5 --- /dev/null +++ b/js/components/converter/string-units-converter.js @@ -0,0 +1,31 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage").Montage, + Converter = require("montage/core/converter/converter").Converter, + NJUtils = require("js/lib/NJUtils").NJUtils; + +exports.StringUnitsConverter = Montage.create(Converter, { + + // convert fahrenheit to celsius (showing our non-metric heritage here) + convert: { + value: function(value) { + if(value) { + console.log("convert string to unit ", value); + var tmp = NJUtils.getValueAndUnits(value); + return tmp[1]; + } + } + }, + + // revert celsius to fahrenheit + revert: { + value: function(value) { + console.log("revert string to unit ", value); + return value; + } + } + +}); diff --git a/js/components/converter/string-value-converter.js b/js/components/converter/string-value-converter.js new file mode 100644 index 00000000..28d7dd29 --- /dev/null +++ b/js/components/converter/string-value-converter.js @@ -0,0 +1,29 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage").Montage, + Converter = require("montage/core/converter/converter").Converter, + NJUtils = require("js/lib/NJUtils").NJUtils; + +exports.StringValueConverter = Montage.create(Converter, { + + // convert fahrenheit to celsius (showing our non-metric heritage here) + convert: { + value: function(value) { + console.log(value); + console.log(parseInt(value)); + return parseInt(value); + } + }, + + // revert celsius to fahrenheit + revert: { + value: function(value) { + console.log("revert string to value ", value); + return value; + } + } + +}); diff --git a/js/components/converter/value-units-converter.js b/js/components/converter/value-units-converter.js deleted file mode 100644 index e4f9aee9..00000000 --- a/js/components/converter/value-units-converter.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ -var Montage = require("montage").Montage, -Converter = require("montage/core/converter/converter").Converter; - -exports.ValueUnitsConverter = Montage.create(Converter, { - - // convert fahrenheit to celsius (showing our non-metric heritage here) - convert: { - value: function(value) { -// return (parseInt(value, 10) - 32) / 1.8; -// console.log(value); - console.log(value); - return parseInt(value); - } - }, - - // revert celsius to fahrenheit - revert: { - value: function(value) { -// return (1.8 * parseInt(value, 10)) + 32; - console.log(value); - } - } - -}); -- cgit v1.2.3 From 919a0d0ed35c24b1047281723ddde2ac98fc9a3e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 15 May 2012 22:36:44 -0700 Subject: document close handler. initial working draft Signed-off-by: Valerio Virgillito --- js/components/layout/document-entry.reel/document-entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index 81a63c90..4d09a362 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -117,7 +117,7 @@ exports.DocumentEntry = Montage.create(Component, { handleClick: { value: function(event) { if(event._event.target.nodeName === "IMG") { - this.application.ninja.documentController.closeDocument(this._uuid); + this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } else { if(!this._document.isActive) { this.application.ninja.stage.stageView.switchDocument(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); -- cgit v1.2.3 From 6dfe2e62b1d7a71daf097aac3a31213d564e6122 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 00:54:30 -0700 Subject: Removing the old checkbox components. Created a new LabelCheckbox Signed-off-by: Valerio Virgillito --- js/components/checkbox.reel/checkbox.html | 23 ---- js/components/checkbox.reel/checkbox.js | 120 --------------------- .../ui/label-checkbox.reel/label-checkbox.css | 9 ++ .../ui/label-checkbox.reel/label-checkbox.html | 54 ++++++++++ .../ui/label-checkbox.reel/label-checkbox.js | 67 ++++++++++++ .../ui/property-control.reel/property-control.js | 2 +- 6 files changed, 131 insertions(+), 144 deletions(-) delete mode 100755 js/components/checkbox.reel/checkbox.html delete mode 100755 js/components/checkbox.reel/checkbox.js create mode 100644 js/components/ui/label-checkbox.reel/label-checkbox.css create mode 100755 js/components/ui/label-checkbox.reel/label-checkbox.html create mode 100755 js/components/ui/label-checkbox.reel/label-checkbox.js (limited to 'js/components') diff --git a/js/components/checkbox.reel/checkbox.html b/js/components/checkbox.reel/checkbox.html deleted file mode 100755 index ded91fc2..00000000 --- a/js/components/checkbox.reel/checkbox.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/js/components/checkbox.reel/checkbox.js b/js/components/checkbox.reel/checkbox.js deleted file mode 100755 index be331f4e..00000000 --- a/js/components/checkbox.reel/checkbox.js +++ /dev/null @@ -1,120 +0,0 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -var Montage = require("montage/core/core").Montage; -var Component = require("montage/ui/component").Component; - -exports.Checkbox = Montage.create(Component, { - - _valueSyncedWithInputField: { - enumerable: false, - value: false - }, - - _wasSetByCode: { - enumerable: false, - value: true - }, - - prependLabel: { - value: false - }, - - label: { - value: null - }, - - value: { - value: false - }, - - _checked: { - enumerable: false, - value: false - }, - - checked: { - enumerable: true, - serializable: true, - get: function() { - return this._checked; - }, - set: function(value) { - this._checked = value; - this.needsDraw = true; - - var e = document.createEvent("CustomEvent"); - e.initEvent("change", true, true); - e.type = "change"; - e.wasSetByCode = this._wasSetByCode; - e.value = value; - this.value = value; - this.dispatchEvent(e); - - this._wasSetByCode = true; - } - }, - - _enabled: { - enumerable: false, - value: true - }, - - enabled: { - enumerable: true, - serializable: true, - get: function() { - return this._enabled; - }, - set: function(value) { - if(value !== this._enabled) - { - this._enabled = value; - this.needsDraw = true; - } - } - }, - - handleChange: - { - value:function(event) - { - this._valueSyncedWithInputField = true; - this._wasSetByCode = false; - this.checked = this.element.checked; - } - }, - handleClick: { - value: function() { - this._wasSetByCode = false; - this.checked = !this.element.checked; - } - }, - - draw: { - value: function() { - this.element.disabled = !this._enabled; - if(!this._valueSyncedWithInputField) - { - this.element.checked = this._checked; - } - this._valueSyncedWithInputField = false; - } - }, - - 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.element.addEventListener("change", this, false); - } - } - -}); \ 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 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +.label-checkbox { + display: inline-block; +} \ 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 @@ + + + + + + + + + + + + + \ 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..82c01262 --- /dev/null +++ b/js/components/ui/label-checkbox.reel/label-checkbox.js @@ -0,0 +1,67 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage; +var Component = require("montage/ui/component").Component; + +exports.LabelCheckbox = Montage.create(Component, { + + _label: { + value: "" + }, + + label: { + get: function() { + return this._label; + }, + set: function(value) { + if(this._label !== value) { + this._label = value; + this.needsDraw = true; + } + } + }, + + _checked: { + value: false + }, + + checked: { + serializable: true, + get: function() { + return this._checked; + }, + set: function(value) { + if(this._checked !== value) { + this._checked = value; + this.needsDraw = true; + } + } + }, + + value: { + value: false + }, + + handleAction: { + value: function(event) { + var e = document.createEvent("CustomEvent"); + e.initEvent("change", true, true); + e.type = "change"; + e.wasSetByCode = false; + this.value = e.value = this._checkbox.checked; + this.dispatchEvent(e); + } + }, + + draw: { + value: function() { + this._labelText.value = this.label; + this._checkbox.checked = this.checked; + } + + } +}); \ 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, HotTextUnit = require("js/components/hottextunit.reel").HotTextUnit, Slider = require("js/components/slider.reel").Slider, Button = require("montage/ui/button.reel").Button, - Checkbox = require("js/components/checkbox.reel").Checkbox, + Checkbox = require("js/components/ui/label-checkbox.reel").LabelCheckbox, Combobox = require("js/components/combobox.reel").Combobox, TextField = require("js/components/TextField.reel").TextField, ColorChip = require("js/components/ui/color-chip.reel").ColorChip, -- cgit v1.2.3 From dadb08aaa017db477f2bfa95727c73e44e482348 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 13:30:32 -0700 Subject: fixing the menu binding resulting in 1 === true > false Signed-off-by: Valerio Virgillito --- js/components/menu/menu-item.reel/menu-item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js index 26fc7573..fc3913b8 100755 --- a/js/components/menu/menu-item.reel/menu-item.js +++ b/js/components/menu/menu-item.reel/menu-item.js @@ -141,7 +141,7 @@ exports.MenuItem = Montage.create(Component, { if(this.data.radio && this.checked) return; - if((this.enabled === true) && (this.submenu === false) ) { + if( ( this.enabled === true || this.enabled > 0 ) && (this.submenu === false) ) { if(this.data.action) { NJevent ( this.data.action ); } else if(this.checked !== null) { -- cgit v1.2.3 From 2c9ed2068b12884fc026fe3a7b57021e7e591f1c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 16:04:22 -0700 Subject: fixing a null value for the document entry bar Signed-off-by: Valerio Virgillito --- js/components/layout/document-entry.reel/document-entry.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/components') diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index 4d09a362..ad0236c6 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -33,8 +33,10 @@ exports.DocumentEntry = Montage.create(Component, { } this._document = value; - this._uuid = value.uuid; - //this.needsDraw = true; + + if(value) { + this._uuid = value.uuid; + } } }, -- cgit v1.2.3 From 65cea92d839bcd25ea9094a0798190a4dc4bea35 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 00:16:43 -0700 Subject: Adding a disabled property to the label-checkbox. Signed-off-by: Valerio Virgillito --- .../ui/label-checkbox.reel/label-checkbox.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/ui/label-checkbox.reel/label-checkbox.js b/js/components/ui/label-checkbox.reel/label-checkbox.js index 82c01262..21b72cb5 100755 --- a/js/components/ui/label-checkbox.reel/label-checkbox.js +++ b/js/components/ui/label-checkbox.reel/label-checkbox.js @@ -42,6 +42,25 @@ exports.LabelCheckbox = Montage.create(Component, { } }, + _enabled: { + enumerable: false, + value: true + }, + + enabled: { + enumerable: true, + serializable: true, + get: function() { + return this._enabled; + }, + set: function(value) { + if(value !== this._enabled) { + this._enabled = value; + this.needsDraw = true; + } + } + }, + value: { value: false }, @@ -52,7 +71,7 @@ exports.LabelCheckbox = Montage.create(Component, { e.initEvent("change", true, true); e.type = "change"; e.wasSetByCode = false; - this.value = e.value = this._checkbox.checked; + this.checked = this.value = e.value = this._checkbox.checked; this.dispatchEvent(e); } }, @@ -61,6 +80,7 @@ exports.LabelCheckbox = Montage.create(Component, { value: function() { this._labelText.value = this.label; this._checkbox.checked = this.checked; + this._checkbox.disabled = !this._enabled; } } -- cgit v1.2.3 From b97570f5daff9d0c40f274c2c29a457079da1c1a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 12:23:31 -0700 Subject: fixing the breadcrumb Signed-off-by: Valerio Virgillito --- .../layout/bread-crumb.reel/bread-crumb.html | 37 ++++++++-------------- .../layout/bread-crumb.reel/bread-crumb.js | 24 ++++---------- 2 files changed, 19 insertions(+), 42 deletions(-) (limited to 'js/components') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index ae3e2022..0dabc781 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html @@ -32,30 +32,23 @@ } ], "bindings": { - "label": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.label", - "oneway": true - }, - "value": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.nodeUuid", - "oneway": true - } + "label": {"<-": "@buttonsList.objectAtCurrentIteration.label"}, + "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"} + } + }, + + "buttonsListController": { + "prototype": "montage/ui/controller/array-controller", + "bindings": { + "content": {"<<->": "@owner.containerElements"} } }, - "repetition1": { + "buttonsList": { "prototype": "montage/ui/repetition.reel", "properties": { - "element": {"#": "breadcrumb_container"} - }, - "bindings": { - "objects": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "containerElements", - "oneway": true - } + "element": {"#": "breadcrumb_container"}, + "contentController": {"@": "buttonsListController"} } }, @@ -65,11 +58,7 @@ "element": {"#": "disabledCondition"} }, "bindings": { - "condition": { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "disabled", - "oneway": true - } + "condition": {"<-": "@owner.disabled"} } } } diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index c1b021a3..d2a6b1e4 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -60,30 +60,18 @@ exports.Breadcrumb = Montage.create(Component, { value: function() { var parentNode; - this.containerElements.length = 0; +// delete this.containerElements; + this.containerElements = []; parentNode = this.container; - // This is for the old template support. - // TODO: Remove marker for old template: NINJA-STAGE-REWORK - if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { - while(parentNode.id !== "UserContent") { - this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); - parentNode = parentNode.parentNode; - } - - // This is always the top container which is now hardcoded to body - this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); - } else { - while(parentNode !== this.application.ninja.currentDocument.documentRoot) { - this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); - parentNode = parentNode.parentNode; - } - - // This is always the top container which is now hardcoded to body + while(parentNode !== this.application.ninja.currentDocument.documentRoot) { this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); + parentNode = parentNode.parentNode; } + // This is always the top container which is now hardcoded to body + this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); } }, -- cgit v1.2.3 From 43994432117686f18eb1783418ef83744ae01d79 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 15:43:40 -0700 Subject: Fixed border radius hot-text linking that was broken by update to montage v.10. Signed-off-by: Nivesh Rajbhandari --- .../rect-properties.reel/rect-properties.html | 49 ++++++++++++-- .../rect-properties.reel/rect-properties.js | 79 +++++++++------------- 2 files changed, 74 insertions(+), 54 deletions(-) (limited to 'js/components') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html index 42746caa..7aa91314 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.html +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html @@ -15,8 +15,19 @@ "prototype": "js/components/hottextunit.reel[HotTextUnit]", "properties": { "element": {"#": "TLRadiusControl"}, - "acceptableUnits" : ["px", "pt", "%"] - } + "acceptableUnits" : ["px", "pt", "%"], + "identifier": "TLRadiusControl" + }, + "listeners": [ + { + "type": "change", + "listener": {"@": "owner"} + }, + { + "type": "changing", + "listener": {"@": "owner"} + } + ] }, "hottext2": { @@ -25,7 +36,13 @@ "element": {"#": "TRRadiusControl"}, "acceptableUnits" : ["px", "pt", "%"], "enabled": false - } + }, + "listeners": [ + { + "type": "change", + "listener": {"@": "owner"} + } + ] }, "hottext3": { @@ -34,7 +51,13 @@ "element": {"#": "BLRadiusControl"}, "acceptableUnits" : ["px", "pt", "%"], "enabled": false - } + }, + "listeners": [ + { + "type": "change", + "listener": {"@": "owner"} + } + ] }, "hottext4": { @@ -43,7 +66,13 @@ "element": {"#": "BRRadiusControl"}, "acceptableUnits" : ["px", "pt", "%"], "enabled": false - } + }, + "listeners": [ + { + "type": "change", + "listener": {"@": "owner"} + } + ] }, "lockButton": { @@ -53,8 +82,14 @@ "pressed": true, "pressedClass": "lockUp", "preventFocus": true, - "identifier": "ratio" - } + "identifier": "lockButton" + }, + "listeners": [ + { + "type": "action", + "listener": {"@": "owner"} + } + ] }, "owner": { diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.js b/js/components/tools-properties/rect-properties.reel/rect-properties.js index c1cb3945..2f8ea4dd 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.js +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.js @@ -19,12 +19,6 @@ exports.RectProperties = Montage.create(ToolProperties, { _subPrepare: { value: function() { - this.lockButton.identifier = "lockButton"; - this.lockButton.addEventListener("action", this, false); - - this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - this._setCap([this.TLRadiusControl,this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } }, @@ -33,11 +27,8 @@ exports.RectProperties = Montage.create(ToolProperties, { this.TRRadiusControl.enabled = this.BLRadiusControl.enabled = this.BRRadiusControl.enabled = !this.lockButton.pressed; if(this.lockButton.pressed) { - this._setBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); - } else { - this._removeBindings([this.TRRadiusControl, this.BLRadiusControl, this.BRRadiusControl]); + this._syncRadii(this.TLRadiusControl.value, this.TLRadiusControl.units); } - } }, @@ -80,57 +71,51 @@ exports.RectProperties = Montage.create(ToolProperties, { get: function() { return this.base._fillMaterial.value; } }, - _setBindings: { - value: function(els) { - var that = this; - els.forEach(function(el) { - Object.defineBinding(el, "value", { - boundObject: that.TLRadiusControl, - boundObjectPropertyPath: "value", - boundValueMutator: function(value) { - if (typeof value === "string") { - return parseFloat(value); - } - - return value; - } - }); - - Object.defineBinding(el, "units", { - boundObject: that.TLRadiusControl, - boundObjectPropertyPath: "units" - }); - }); - } - }, + handleChanging: { + value: function(event) { + if(event.wasSetByCode) { + return; + } - _removeBindings: { - value: function(els) { - els.forEach(function(el) { - Object.deleteBindings(el); - }); + this._setBorderRadius(event); } }, - _setCap: { - value: function(els) { - var that = this; - els.forEach(function(el) { - el.addEventListener("change", that, false); - }); + handleChange: { + value: function(event) { + if(event.wasSetByCode) { + return; + } + + this._setBorderRadius(event); } }, - handleChange: { + _setBorderRadius: { value: function(event) { var hotTxt = event.currentTarget; if(hotTxt.units === "%") { if(hotTxt.value > 50) { hotTxt.maxValue = 50; } - return hotTxt.value; } - + + if(this.lockButton.pressed && (this.TLRadiusControl === hotTxt)) { + this._syncRadii(hotTxt.value, hotTxt.units); + } + } + }, + + _syncRadii: { + value: function(value, units) { + this.TRRadiusControl.value = value; + this.BLRadiusControl.value = value; + this.BRRadiusControl.value = value; + + this.TRRadiusControl.units = units; + this.BLRadiusControl.units = units; + this.BRRadiusControl.units = units; } } + }); \ No newline at end of file -- cgit v1.2.3 From 6636b2729b421740e49142b7e8b1a76540508306 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 17 May 2012 15:46:56 -0700 Subject: Removed unneeded identifier. Signed-off-by: Nivesh Rajbhandari --- .../tools-properties/rect-properties.reel/rect-properties.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/components') diff --git a/js/components/tools-properties/rect-properties.reel/rect-properties.html b/js/components/tools-properties/rect-properties.reel/rect-properties.html index 7aa91314..a7bf6a7c 100755 --- a/js/components/tools-properties/rect-properties.reel/rect-properties.html +++ b/js/components/tools-properties/rect-properties.reel/rect-properties.html @@ -15,8 +15,7 @@ "prototype": "js/components/hottextunit.reel[HotTextUnit]", "properties": { "element": {"#": "TLRadiusControl"}, - "acceptableUnits" : ["px", "pt", "%"], - "identifier": "TLRadiusControl" + "acceptableUnits" : ["px", "pt", "%"] }, "listeners": [ { -- cgit v1.2.3