From 1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 2 Mar 2012 10:55:51 -0800 Subject: CSS Panel - Updating components, created toolbar components, and small changes to styles controller --- js/components/toolbar.reel/toolbar.css | 14 ++++++++++++++ js/components/toolbar.reel/toolbar.html | 34 +++++++++++++++++++++++++++++++++ js/components/toolbar.reel/toolbar.js | 27 ++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 js/components/toolbar.reel/toolbar.css create mode 100644 js/components/toolbar.reel/toolbar.html create mode 100644 js/components/toolbar.reel/toolbar.js (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar.css b/js/components/toolbar.reel/toolbar.css new file mode 100644 index 00000000..1ffae912 --- /dev/null +++ b/js/components/toolbar.reel/toolbar.css @@ -0,0 +1,14 @@ +/* + 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. +
*/ +.toolbar-container { + background-color: #474747; + border-bottom: 1px solid #333; + border-top: 1px solid #505050; + box-shadow: 0 4px 8px 0px rgba(0,0,0,0.75); + height: 22px; + width: 100%; + -webkit-box-flex: 0; +} \ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html new file mode 100644 index 00000000..8ccce126 --- /dev/null +++ b/js/components/toolbar.reel/toolbar.html @@ -0,0 +1,34 @@ + + + + + + + + + +
+
+ + \ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js new file mode 100644 index 00000000..79e7ff1f --- /dev/null +++ b/js/components/toolbar.reel/toolbar.js @@ -0,0 +1,27 @@ +/* + 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, + Component = require("montage/ui/component").Component; + +exports.Toolbar = Montage.create(Component, { + + deserializedFromTemplate : { + value: function() { + console.log("toolbar - deserialized"); + } + }, + prepareForDraw : { + value: function() { + console.log("toolbar - prepare for draw"); + } + }, + draw : { + value: function() { + console.log("toolbar - draw"); + } + } +}); \ No newline at end of file -- cgit v1.2.3 From ec862af55e5c3d564b37eac2744a1a6815f81f4d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 12 Mar 2012 15:28:40 -0700 Subject: Tree Node Component - Added method for handling source object set --- js/components/treeview/tree-node.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/components') diff --git a/js/components/treeview/tree-node.js b/js/components/treeview/tree-node.js index d7b864b5..fa6e1ba4 100644 --- a/js/components/treeview/tree-node.js +++ b/js/components/treeview/tree-node.js @@ -52,6 +52,10 @@ exports.TreeNode = Montage.create(Component, { }, this); } this._sourceObject = object; + + if(this.handleSourceObjectSet) { + this.handleSourceObjectSet(); + } } }, childNodes : { -- cgit v1.2.3 From 30e3f3d6c19025c37694127ac148146277681994 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 3 Apr 2012 14:43:52 -0700 Subject: CSS Panel - Stylesheet edit mode --- js/components/toolbar.reel/toolbar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html index 8ccce126..69eba194 100644 --- a/js/components/toolbar.reel/toolbar.html +++ b/js/components/toolbar.reel/toolbar.html @@ -18,7 +18,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } }, "button": { - "module": "js/components/button.reel", + "module": "montage/ui/button.reel", "name": "Button", "properties": { -- cgit v1.2.3 From 7246efab402664c75bd0de226c0b9a91b384839b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 11 Apr 2012 16:45:23 -0700 Subject: CSS Style - Add disabled UI state. Added Hintable and editable UI state. --- js/components/editable.reel/editable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/components') diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index 9c8946c4..ef4096fd 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -122,7 +122,7 @@ exports.Editable = Montage.create(Component, { if(this.stopOnBlur) { console.log('adding mousedown event listener'); ///// Simulate blur on editable node by listening to the doc - document.addEventListener('mouseup', this, false); + document.addEventListener('mousedown', this, false); } this._sendEvent('start'); @@ -179,7 +179,7 @@ exports.Editable = Montage.create(Component, { this.accept(); } this.stop(); - document.removeEventListener('mouseup', this, false); + document.removeEventListener('mousedown', this, false); this._sendEvent('blur'); } }, @@ -202,7 +202,7 @@ exports.Editable = Montage.create(Component, { this._sendEvent('input'); } }, - handleMouseup : { + handleMousedown : { value : function(e) { console.log('handle mouse down'); ///// Listen for simulated blur event -- cgit v1.2.3 From 0e1f95945434475adbf33b2073b6f8d7240aca91 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 23 Apr 2012 11:46:14 -0700 Subject: Editable - Pass event data with stop event --- js/components/editable.reel/editable.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'js/components') diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index ef4096fd..1ebe33f1 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -131,11 +131,11 @@ exports.Editable = Montage.create(Component, { } }, stop : { - value: function() { + value: function(eventData) { this._isEditable = this._element.contentEditable = false; this._element.classList.remove(this.editingClass); - this._sendEvent('stop'); + this._sendEvent('stop', eventData); ///// if value is different than pre-edit val, call onchange method if(this._preEditValue !== this.value) { @@ -174,11 +174,11 @@ exports.Editable = Montage.create(Component, { } }, blur : { - value : function() { + value : function(eventData) { if(this._hint) { this.accept(); } - this.stop(); + this.stop(eventData); document.removeEventListener('mousedown', this, false); this._sendEvent('blur'); } @@ -207,7 +207,10 @@ exports.Editable = Montage.create(Component, { console.log('handle mouse down'); ///// Listen for simulated blur event if(this.stopOnBlur && e._event.target !== this._element) { - this.blur(); + this.blur({ + "originalEventType": "mousedown", + "originalEvent": e + }); } } }, @@ -221,9 +224,9 @@ exports.Editable = Montage.create(Component, { } }, _sendEvent : { - value : function(type) { + value : function(type, data) { var evt = document.createEvent("CustomEvent"); - evt.initCustomEvent(type, true, true); + evt.initCustomEvent(type, true, true, data); this.dispatchEvent(evt); } }, -- cgit v1.2.3 From 4cefebd99813f05713deb2f72bba0a035dfcb508 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 23 Apr 2012 11:46:54 -0700 Subject: Toolbar - Add buttons to toolbar component --- js/components/toolbar.reel/toolbar.css | 39 ++++++++++++++++++++++++++++++ js/components/toolbar.reel/toolbar.html | 43 +++++++++++++++++++++++++++++++-- js/components/toolbar.reel/toolbar.js | 40 ++++++++++++++++++++++++++---- 3 files changed, 115 insertions(+), 7 deletions(-) (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar.css b/js/components/toolbar.reel/toolbar.css index 1ffae912..e63b043e 100644 --- a/js/components/toolbar.reel/toolbar.css +++ b/js/components/toolbar.reel/toolbar.css @@ -3,12 +3,51 @@ 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. */ + +/*--------------------- + Toolbar Container +-----------------------*/ + .toolbar-container { background-color: #474747; border-bottom: 1px solid #333; border-top: 1px solid #505050; box-shadow: 0 4px 8px 0px rgba(0,0,0,0.75); height: 22px; + overflow: hidden; width: 100%; -webkit-box-flex: 0; +} +.toolbar-container ul, .toolbar-container li { + margin: 0; + padding: 0; +} + +/*--------------------- + Button Types +-----------------------*/ + +.toolbar-add-button { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1%2BjfqAAAACXBIWXMAAAsTAAALEwEAmpwYAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8%2FL5UBFTAyMHy7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N%2BQWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BSMDVQYqg4jIKAUICxE%2BCDEESC4tKoMHJQODAIMCgwGDA0MAQyJDPcMChqMMbxjFGV0YSxlXMN5jEmMKYprAdIFZmDmSeSHzGxZLlg6WW6x6rK2s99gs2aaxfWMPZ9%2FNocTRxfGFM5HzApcj1xZuTe4FPFI8U3mFeCfxCfNN45fhXyygI7BD0FXwilCq0A%2FhXhEVkb2i4aJfxCaJG4lfkaiQlJM8JpUvLS19QqZMVl32llyfvIv8H4WtioVKekpvldeqFKiaqP5UO6jepRGqqaT5QeuA9iSdVF0rPUG9V%2FpHDBYY1hrFGNuayJsym740u2C%2B02KJ5QSrOutcmzjbQDtXe2sHY0cdJzVnJRcFV3k3BXdlD3VPXS8Tbxsfd99gvwT%2F%2FID6wIlBS4N3hVwMfRnOFCEXaRUVEV0RMzN2T9yDBLZE3aSw5IaUNak30zkyLDIzs%2BZmX8xlz7PPryjYVPiuWLskq3RV2ZsK%2FcqSql01jLVedVPrHzbqNdU0n22VaytsP9op3VXUfbpXta%2Bx%2F%2B5Em0mzJ%2F%2BdGj%2Ft8AyNmf2zvs9JmHt6vvmCpYtEFrcu%2BbYsc%2Fm9lSGrTq9xWbtvveWGbZtMNm%2FZarJt%2Bw6rnft3u%2B45uy9s%2F4ODOYd%2BHmk%2FJn58xUnrU%2BfOJJ%2F9dX7SRe1LR68kXv13fc5Nm1t379TfU75%2F4mHeY7En%2B59lvhB5efB1%2Flv5dxc%2BNH0y%2Ffzq64Lv4T8Ffp360%2FrP8f9%2FAA0ADzT6lvFdAAAAIGNIUk0AAHolAACAgwAA%2Bf8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAADPSURBVHjadNC7TQNREIXh75oNCIlWG0JC7BJoAmrAIVAAIkRCog9ThFtwCYTrtS2vBBKbDcG%2BbLD%2F5GpGc885M8nAItZga5YcYx4tD6Fw3ncn40Aa36mLIwM94YRC%2FFHqqkVshCRwCz6QhGRjloZo%2F1nFYygmTlC1ptNsbOTgy7czsJYosq2nLuK1e%2Fx4o0u1Qza7cuMS5s%2BVXC68v4xWmUbZFzkqiUatAWWmtmzPkrpoqC27b82BQoU1NEqfvcXeJV%2FB7mDdvYG7Ie4%2BvwMA%2BFNeHV16KUYAAAAASUVORK5CYII%3D); +} + +/*--------------------- + Generic button styles +-----------------------*/ + +.toolbar-container .toolbar-button { + background-color: transparent; + background-repeat: no-repeat; + border-style: none; + border-radius: 4px; + height: 16px; + margin: 3px 5px 0 0; + padding: 0 2px; + opacity: .85; + text-indent: -9999999px; + width: 16px; + float: right; +} +.left-button { + float: left; } \ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html index 69eba194..53c6627a 100644 --- a/js/components/toolbar.reel/toolbar.html +++ b/js/components/toolbar.reel/toolbar.html @@ -14,14 +14,50 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "module" : "js/panels/css-panel/style-sheet.reel", "name" : "StyleSheet", "properties" : { - "element" : {"#" : "toolbar-container"} + "element" : {"#" : "toolbar-container"}, + "repetition": {"@": "buttonList" } } }, + + "buttonList": { + "module": "montage/ui/repetition.reel", + "name": "Repetition", + "properties": { + "element": {"#": "repetition"} + }, + "bindings": { + "objects" : { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "buttons", + "oneway": true + } + + } + }, + "button": { "module": "montage/ui/button.reel", "name": "Button", "properties": { - + "element": {"#": "button" }, + "label": " " + }, + "bindings": { + "label" : { + "boundObject": {"@": "buttonList"}, + "boundObjectPropertyPath": "objectAtCurrentIteration.title", + "oneway": true + }, + "identifier": { + "boundObject": {"@": "buttonList"}, + "boundObjectPropertyPath": "objectAtCurrentIteration.identifier", + "oneway": true + }, + "sourceObject": { + "boundObject": {"@": "buttonList"}, + "boundObjectPropertyPath": "objectAtCurrentIteration", + "oneway": true + } } } } @@ -29,6 +65,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
+
\ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index 79e7ff1f..03edf477 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -8,20 +8,50 @@ var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; exports.Toolbar = Montage.create(Component, { - - deserializedFromTemplate : { - value: function() { - console.log("toolbar - deserialized"); + _needsButtonProperties : { + value: null + }, + _buttons : { value: null }, + buttons : { + get: function() { + return this._buttons; + }, + set: function(btns) { + this._buttons = btns; + this._needsButtonProperties = true; + console.log("buttons set"); } }, prepareForDraw : { value: function() { console.log("toolbar - prepare for draw"); + if(this._needsButtonProperties) { + this.repetition.childComponents.forEach(function(button) { + button.identifier = button.sourceObject.identifier; + button.addEventListener('action', this.delegate, false); + }, this); + } } }, draw : { value: function() { - console.log("toolbar - draw"); + console.log("toolbar - draw - repetition ", this.repetition); + if(this._needsClass) { + + this.repetition.childComponents.forEach(function(button) { + button.element.classList.add('toolbar-' + button.sourceObject.identifier + '-button'); + }, this); + } + + if(this._needsButtonProperties) { + this._needsClass = this.needsDraw = true; + this._needsButtonProperties = false; + } + + } + }, + _needsClass : { + value: null } }); \ No newline at end of file -- cgit v1.2.3 From 76e4821c207736f9f0d88de91246e2cf08f5f6c0 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 30 Apr 2012 13:47:23 -0700 Subject: Editable - Add paste event handling/dispatching --- js/components/editable.reel/editable.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'js/components') diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index 1ebe33f1..f2cf0e5d 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -39,7 +39,9 @@ exports.Editable = Montage.create(Component, { this._element = el; this._element.addEventListener('keydown', this, false); this._element.addEventListener('input', this, false); - + this._element.addEventListener('paste', this, false); + + if(this.startOnEvent) { this._element.addEventListener(this.startOnEvent, this, false); } @@ -136,7 +138,9 @@ exports.Editable = Montage.create(Component, { this._element.classList.remove(this.editingClass); this._sendEvent('stop', eventData); - + + document.removeEventListener('mousedown', this, false); + ///// if value is different than pre-edit val, call onchange method if(this._preEditValue !== this.value) { this._sendEvent('change'); @@ -179,7 +183,6 @@ exports.Editable = Montage.create(Component, { this.accept(); } this.stop(eventData); - document.removeEventListener('mousedown', this, false); this._sendEvent('blur'); } }, @@ -214,6 +217,11 @@ exports.Editable = Montage.create(Component, { } } }, + handlePaste : { + value: function(e) { + this._sendEvent('paste', e); + } + }, handleEvent : { value : function(e) { console.log("event type : " + e._event.type); -- cgit v1.2.3 From ae94b22c27b9b155e94bf140631e7faf8f55c6c0 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 30 Apr 2012 13:47:42 -0700 Subject: Tree Controller -Delegate getter/setter --- js/components/controllers/tree-controller.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'js/components') diff --git a/js/components/controllers/tree-controller.js b/js/components/controllers/tree-controller.js index 1e9222fd..cb95ca1d 100644 --- a/js/components/controllers/tree-controller.js +++ b/js/components/controllers/tree-controller.js @@ -23,6 +23,16 @@ var Montage = require("montage").Montage, */ var TreeController = exports.TreeController = Montage.create(ObjectController, /** @lends module:montage/ui/controller/tree-controller.TreeController# */ { + _delegate : { value: null }, + delegate : { + get: function() { + return this._delegate; + }, + set: function(value) { + this._delegate = value; + } + }, + rootKey : { value: null }, -- cgit v1.2.3 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 8bea1e0807f36595d762592c030d4810396ada85 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 2 May 2012 15:30:27 -0700 Subject: CSS Panel - Add focus management to styles view delegate --- js/components/treeview/treeview.reel/treeview.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/components') diff --git a/js/components/treeview/treeview.reel/treeview.js b/js/components/treeview/treeview.reel/treeview.js index ebbfe685..9f78d36d 100644 --- a/js/components/treeview/treeview.reel/treeview.js +++ b/js/components/treeview/treeview.reel/treeview.js @@ -11,6 +11,7 @@ exports.Treeview = Montage.create(Component, { substitution : { value : null }, data : { value : null }, + rootBranch : { value : null }, _hasBeenDeserialized: { value: false, @@ -54,6 +55,8 @@ exports.Treeview = Montage.create(Component, { this.slot.content = rootBranch; rootBranch.sourceObject = this.contentController.root; rootBranch.needsDraw = true; + this.rootBranch = rootBranch; + this.needsDraw = true; } @@ -85,6 +88,8 @@ exports.Treeview = Montage.create(Component, { if (this._contentController) { +//this._initializeRootBranch(); + // And bind what we need from the new contentController var selectedIndexesBindingDescriptor; -- cgit v1.2.3 From fc104084e964023263332dbf2d916bf00d525e8b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 3 May 2012 11:48:46 -0700 Subject: Panel Toolbar - Support hiding and showing of buttons --- js/components/toolbar.reel/toolbar.css | 13 ++++++-- js/components/toolbar.reel/toolbar.js | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar.css b/js/components/toolbar.reel/toolbar.css index e63b043e..b765f636 100644 --- a/js/components/toolbar.reel/toolbar.css +++ b/js/components/toolbar.reel/toolbar.css @@ -18,7 +18,13 @@ width: 100%; -webkit-box-flex: 0; } -.toolbar-container ul, .toolbar-container li { +.toolbar-container ul { + padding: 0 5px; + margin: 0; +} +.toolbar-container li { + display: inline-block; + float: right; margin: 0; padding: 0; } @@ -48,6 +54,9 @@ width: 16px; float: right; } -.left-button { +.toolbar-container .left-button { float: left; +} +.toolbar-container .hide-button { + display: none; } \ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index 03edf477..dbff2db6 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -11,6 +11,8 @@ exports.Toolbar = Montage.create(Component, { _needsButtonProperties : { value: null }, + leftAlignClass : { value: "left-button" }, + hideButtonClass : { value: "hide-button" }, _buttons : { value: null }, buttons : { get: function() { @@ -22,6 +24,44 @@ exports.Toolbar = Montage.create(Component, { console.log("buttons set"); } }, + + _buttonToHide : { + value: null + }, + _buttonToShow : { + value: null + }, + getButton : { + value: function(identifier) { + var buttons = this.repetition.childComponents, + buttonIds = buttons.map(function(component) { + return component.sourceObject.identifier; + }); + + return buttons[buttonIds.indexOf(identifier)]; + } + }, + hideButton : { + value: function(identifier) { + var button = this.getButton(identifier); + + if(button) { + this._buttonToHide = button; + this.needsDraw = true; + } + } + }, + showButton : { + value: function(identifier) { + var button = this.getButton(identifier); + + if(button) { + this._buttonToShow = button; + this.needsDraw = true; + } + } + }, + prepareForDraw : { value: function() { console.log("toolbar - prepare for draw"); @@ -40,7 +80,14 @@ exports.Toolbar = Montage.create(Component, { this.repetition.childComponents.forEach(function(button) { button.element.classList.add('toolbar-' + button.sourceObject.identifier + '-button'); + + ///// add left align class if specified in serialization + if(button.sourceObject.leftAlign) { + button.element.parentElement.classList.add(this.leftAlignClass); + } }, this); + + this._needsClass = false; } if(this._needsButtonProperties) { @@ -48,6 +95,14 @@ exports.Toolbar = Montage.create(Component, { this._needsButtonProperties = false; } + if(this._buttonToHide) { + this._buttonToHide.element.classList.add(this.hideButtonClass); + this._buttonToHide = null; + } + if(this._buttonToShow) { + this._buttonToShow.element.classList.remove(this.hideButtonClass); + this._buttonToShow = null; + } } }, -- cgit v1.2.3 From b52222a0e165825bf507b4f69b33d51c84eb85d4 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 10 May 2012 15:11:40 -0700 Subject: CSS Panel - Fix errors from new Montage and remove logs. --- js/components/toolbar.reel/toolbar.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index dbff2db6..bc3cbd08 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -21,7 +21,6 @@ exports.Toolbar = Montage.create(Component, { set: function(btns) { this._buttons = btns; this._needsButtonProperties = true; - console.log("buttons set"); } }, @@ -64,7 +63,6 @@ exports.Toolbar = Montage.create(Component, { prepareForDraw : { value: function() { - console.log("toolbar - prepare for draw"); if(this._needsButtonProperties) { this.repetition.childComponents.forEach(function(button) { button.identifier = button.sourceObject.identifier; @@ -75,7 +73,6 @@ exports.Toolbar = Montage.create(Component, { }, draw : { value: function() { - console.log("toolbar - draw - repetition ", this.repetition); if(this._needsClass) { this.repetition.childComponents.forEach(function(button) { -- 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.