diff options
author | Eric Guzman | 2012-06-18 16:01:31 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-18 16:01:31 -0700 |
commit | 54674d9160475f1bb72bd7eaacb2da0fb51863f4 (patch) | |
tree | c92926836a832164d93547857a8165caacbf108d /js | |
parent | b7e739311d9ddeb99029313cae9395878c7f7706 (diff) | |
download | ninja-54674d9160475f1bb72bd7eaacb2da0fb51863f4.tar.gz |
Edit Binding View - Handle no object for icon
Diffstat (limited to 'js')
-rw-r--r-- | js/panels/binding/edit-binding-view.reel/edit-binding-view.css | 5 | ||||
-rw-r--r-- | js/panels/binding/edit-binding-view.reel/edit-binding-view.js | 10 |
2 files changed, 13 insertions, 2 deletions
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 955cff3a..634f391c 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 | |||
@@ -55,13 +55,16 @@ | |||
55 | position:relative; | 55 | position:relative; |
56 | top: -1px; | 56 | top: -1px; |
57 | left: -1px; | 57 | left: -1px; |
58 | -webkit-transition: opacity 200ms linear; | ||
58 | } | 59 | } |
59 | .object-fields-container { | 60 | .object-fields-container { |
60 | -webkit-box-flex: 1; | 61 | -webkit-box-flex: 1; |
61 | padding-top: 1px; | 62 | padding-top: 1px; |
62 | width: 1px; | 63 | width: 1px; |
63 | } | 64 | } |
64 | 65 | .no-object { | |
66 | opacity: 0; | ||
67 | } | ||
65 | 68 | ||
66 | .edit-binding-view ul { | 69 | .edit-binding-view ul { |
67 | padding: 0; | 70 | padding: 0; |
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 8fd6a48e..5ee8c65a 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 | |||
@@ -32,6 +32,7 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { | |||
32 | sourceObjectIdentifier : { | 32 | sourceObjectIdentifier : { |
33 | get : function() { return this._sourceObjectIdentifier; }, | 33 | get : function() { return this._sourceObjectIdentifier; }, |
34 | set : function(value) { | 34 | set : function(value) { |
35 | console.log("Source object IDENTIFIER changed"); | ||
35 | if(value === this._sourceObjectIdentifier) { return; } | 36 | if(value === this._sourceObjectIdentifier) { return; } |
36 | 37 | ||
37 | this._sourceObjectIdentifier = value; | 38 | this._sourceObjectIdentifier = value; |
@@ -44,6 +45,7 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { | |||
44 | boundObjectIdentifier : { | 45 | boundObjectIdentifier : { |
45 | get : function() { return this._boundObjectIdentifier; }, | 46 | get : function() { return this._boundObjectIdentifier; }, |
46 | set : function(value) { | 47 | set : function(value) { |
48 | console.log("Bound object IDENTIFIER changed"); | ||
47 | if(value === this._boundObjectIdentifier) { return; } | 49 | if(value === this._boundObjectIdentifier) { return; } |
48 | 50 | ||
49 | this._boundObjectIdentifier = value; | 51 | this._boundObjectIdentifier = value; |
@@ -66,7 +68,6 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { | |||
66 | this._sourceObject = value; | 68 | this._sourceObject = value; |
67 | 69 | ||
68 | if(value) { | 70 | if(value) { |
69 | |||
70 | this.sourceObjectPropertyPathField.hints = this.application.ninja.objectsController.getPropertiesFromObject(value); | 71 | this.sourceObjectPropertyPathField.hints = this.application.ninja.objectsController.getPropertiesFromObject(value); |
71 | console.log("Setting hints to: ", this.sourceObjectPropertyPathField.hints); | 72 | console.log("Setting hints to: ", this.sourceObjectPropertyPathField.hints); |
72 | } | 73 | } |
@@ -273,6 +274,7 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { | |||
273 | handleEvent : { | 274 | handleEvent : { |
274 | value: function(e) { | 275 | value: function(e) { |
275 | if(e._event.type === 'change') { | 276 | if(e._event.type === 'change') { |
277 | console.log("here we are"); | ||
276 | this.dirty = true; | 278 | this.dirty = true; |
277 | } | 279 | } |
278 | } | 280 | } |
@@ -319,19 +321,25 @@ var editBindingView = exports.EditBindingView = Montage.create(Component, { | |||
319 | this.boundObjectIconElement.className = defaultIconClass; | 321 | this.boundObjectIconElement.className = defaultIconClass; |
320 | 322 | ||
321 | if(this.sourceObject) { | 323 | if(this.sourceObject) { |
324 | this.sourceObjectIconElement.classList.remove('no-object'); | ||
322 | category = controller.getObjectCategory(this.sourceObject).toLowerCase(); | 325 | category = controller.getObjectCategory(this.sourceObject).toLowerCase(); |
323 | 326 | ||
324 | if(category) { | 327 | if(category) { |
325 | this.sourceObjectIconElement.classList.add('object-icon-'+category); | 328 | this.sourceObjectIconElement.classList.add('object-icon-'+category); |
326 | } | 329 | } |
330 | } else { | ||
331 | this.sourceObjectIconElement.classList.add('no-object'); | ||
327 | } | 332 | } |
328 | 333 | ||
329 | if(this.boundObject) { | 334 | if(this.boundObject) { |
335 | this.boundObjectIconElement.classList.remove('no-object'); | ||
330 | category = controller.getObjectCategory(this.boundObject).toLowerCase() || null; | 336 | category = controller.getObjectCategory(this.boundObject).toLowerCase() || null; |
331 | 337 | ||
332 | if(category) { | 338 | if(category) { |
333 | this.boundObjectIconElement.classList.add('object-icon-'+category); | 339 | this.boundObjectIconElement.classList.add('object-icon-'+category); |
334 | } | 340 | } |
341 | } else { | ||
342 | this.boundObjectIconElement.classList.add('no-object'); | ||
335 | } | 343 | } |
336 | } | 344 | } |
337 | } | 345 | } |