From b7e739311d9ddeb99029313cae9395878c7f7706 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 18 Jun 2012 13:23:05 -0700 Subject: Binding - Show tray when there are objects. Edit binding view css update. --- .../binding/edit-binding-view.reel/edit-binding-view.css | 4 ++++ js/panels/binding/edit-binding-view.reel/edit-binding-view.js | 11 +++++++++++ js/stage/objects-tray.reel/objects-tray.js | 9 ++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/js/panels/binding/edit-binding-view.reel/edit-binding-view.css b/js/panels/binding/edit-binding-view.reel/edit-binding-view.css index 01feb5cc..955cff3a 100644 --- a/js/panels/binding/edit-binding-view.reel/edit-binding-view.css +++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.css @@ -116,6 +116,10 @@ width: 80%; } +.hintable-field .hintable-hint { + color: #7C7C7C; +} + .hintable-field:focus { border: 1px solid #313131; } \ No newline at end of file diff --git a/js/panels/binding/edit-binding-view.reel/edit-binding-view.js b/js/panels/binding/edit-binding-view.reel/edit-binding-view.js index 62a47aaf..8fd6a48e 100644 --- a/js/panels/binding/edit-binding-view.reel/edit-binding-view.js +++ b/js/panels/binding/edit-binding-view.reel/edit-binding-view.js @@ -65,6 +65,12 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { this._sourceObject = value; + if(value) { + + this.sourceObjectPropertyPathField.hints = this.application.ninja.objectsController.getPropertiesFromObject(value); + console.log("Setting hints to: ", this.sourceObjectPropertyPathField.hints); + } + this.needsDraw = true; } }, @@ -77,6 +83,11 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { console.log("Bound Object being set to ", value); this._boundObject = value; + if(value) { + this.boundObjectPropertyPathField.hints = this.application.ninja.objectsController.getPropertiesFromObject(value); + console.log("Setting hints to: ", this.boundObjectPropertyPathField.hints); + } + this.needsDraw = true; } }, diff --git a/js/stage/objects-tray.reel/objects-tray.js b/js/stage/objects-tray.reel/objects-tray.js index c046a3bb..190abf57 100644 --- a/js/stage/objects-tray.reel/objects-tray.js +++ b/js/stage/objects-tray.reel/objects-tray.js @@ -13,6 +13,7 @@ var Montage = require("montage/core/core").Montage, exports.ObjectsTray = Montage.create(Component, { hideClass : { value: 'hide-objects-tray'}, + _empty : { value: null }, _workspaceMode : { value: null }, workspaceMode : { get : function() { return this._workspaceMode; }, @@ -76,11 +77,17 @@ exports.ObjectsTray = Montage.create(Component, { "oneway": true }); + if(this.objects) { + this.empty = !this.objects.length; + } else { + this.empty = true; + } + } }, draw : { value: function() { - if(this.hide) { + if(this.hide || this._empty) { this.element.classList.add(this.hideClass); } else { this.element.classList.remove(this.hideClass); -- cgit v1.2.3