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/layout') 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 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/components/layout/document-entry.reel/document-entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/components/layout') 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, { if(event._event.target.nodeName === "IMG") { 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)); + if(!this.active) { + this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } } } -- cgit v1.2.3 From 8247cddcc7ddce25a6282e97d304cad9a0f0c4f3 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:06:31 -0700 Subject: fixed the shape subtool not refreshing the icon Signed-off-by: Valerio Virgillito --- js/components/layout/tool-button.reel/tool-button.html | 4 ++++ js/components/layout/tool-button.reel/tool-button.js | 11 ----------- js/components/layout/tools-list.reel/tools-list.html | 12 ++---------- 3 files changed, 6 insertions(+), 21 deletions(-) (limited to 'js/components/layout') 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 @@ "prototype": "js/components/layout/tool-button.reel", "properties": { "element": {"#": "toolBarButton"} + }, + "bindings": { + "selected": {"<<->": "@owner.data.selected"}, + "subselected": {"<-": "@owner.data.subtools.selected"} } } } 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, { this.element.addEventListener("mousedown", this, false); this.element.addEventListener("dblclick", this, false); - Object.defineBinding(this, "selected", { - boundObject: this.data, - boundObjectPropertyPath: "selected", - oneway: false - }); - if(this.data.container) { this.element.title = this.data.subtools[this._subselected].toolTip; - Object.defineBinding(this, "subselected", { - boundObject: this.data.subtools, - boundObjectPropertyPath: "selected", - oneway: true - }); } 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 @@ "element": {"#": "toolbutton"} }, "bindings": { - "data": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "data": {"<-": "@repetition1.objectAtCurrentIteration"} } }, @@ -30,11 +26,7 @@ "element": {"#": "groupLine"} }, "bindings": { - "condition": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup", - "oneway": true - } + "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"} } }, -- cgit v1.2.3