diff options
author | Armen Kesablyan | 2012-06-18 19:12:32 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-18 19:12:32 -0700 |
commit | 1b2e102b3519994c79b63be44fccb79cf5712fef (patch) | |
tree | f38534a7d8a3dc75909419a4bd823db73f771435 /js/stage | |
parent | 2fcb74d0b204ce2999b70fa9a46fc58a558344d8 (diff) | |
parent | e04903ed2d2e6754119550cb071e03878bb1b14b (diff) | |
download | ninja-1b2e102b3519994c79b63be44fccb79cf5712fef.tar.gz |
Merge pull request #16 from ericguzman/binding
Objects Tray - Moved to stage object from binding view
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/binding-view.reel/binding-view.css | 2 | ||||
-rwxr-xr-x | js/stage/binding-view.reel/binding-view.html | 14 | ||||
-rw-r--r-- | js/stage/objects-tray.reel/objects-tray.js | 9 |
3 files changed, 17 insertions, 8 deletions
diff --git a/js/stage/binding-view.reel/binding-view.css b/js/stage/binding-view.reel/binding-view.css index a08def8a..543577d1 100755 --- a/js/stage/binding-view.reel/binding-view.css +++ b/js/stage/binding-view.reel/binding-view.css | |||
@@ -25,7 +25,7 @@ | |||
25 | } | 25 | } |
26 | 26 | ||
27 | .objects-tray-container { | 27 | .objects-tray-container { |
28 | bottom: 11px; | 28 | bottom: 10px; |
29 | position: absolute; | 29 | position: absolute; |
30 | width: 100%; | 30 | width: 100%; |
31 | display: -webkit-box; | 31 | display: -webkit-box; |
diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html index 9a127618..91c9e397 100755 --- a/js/stage/binding-view.reel/binding-view.html +++ b/js/stage/binding-view.reel/binding-view.html | |||
@@ -27,6 +27,12 @@ | |||
27 | "objects": {"<-": "@owner.bindables"} | 27 | "objects": {"<-": "@owner.bindables"} |
28 | } | 28 | } |
29 | }, | 29 | }, |
30 | "objectsTray" : { | ||
31 | "prototype": "js/stage/objects-tray.reel", | ||
32 | "properties": { | ||
33 | "element": {"#": "objects-tray" } | ||
34 | } | ||
35 | }, | ||
30 | "hud": { | 36 | "hud": { |
31 | "prototype": "js/stage/binding-view.reel/binding-hud.reel", | 37 | "prototype": "js/stage/binding-view.reel/binding-hud.reel", |
32 | "properties": { | 38 | "properties": { |
@@ -41,12 +47,6 @@ | |||
41 | "listener": {"@": "owner"} | 47 | "listener": {"@": "owner"} |
42 | } | 48 | } |
43 | ] | 49 | ] |
44 | }, | ||
45 | "objectsTray" : { | ||
46 | "prototype": "js/stage/objects-tray.reel", | ||
47 | "properties": { | ||
48 | "element": {"#": "objects-tray" } | ||
49 | } | ||
50 | } | 50 | } |
51 | } | 51 | } |
52 | </script> | 52 | </script> |
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | 57 | ||
58 | <section data-montage-id="bindingView" class="bindingView"> | 58 | <section data-montage-id="bindingView" class="bindingView"> |
59 | |||
59 | <div data-montage-id="hudRepeater" class="hudRepeater"> | 60 | <div data-montage-id="hudRepeater" class="hudRepeater"> |
60 | <div data-montage-id="hud"> | 61 | <div data-montage-id="hud"> |
61 | 62 | ||
@@ -65,6 +66,7 @@ | |||
65 | <div class="objects-tray-container"> | 66 | <div class="objects-tray-container"> |
66 | <div data-montage-id="objects-tray" ></div> | 67 | <div data-montage-id="objects-tray" ></div> |
67 | </div> | 68 | </div> |
69 | |||
68 | </section> | 70 | </section> |
69 | 71 | ||
70 | </body> | 72 | </body> |
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, | |||
13 | 13 | ||
14 | exports.ObjectsTray = Montage.create(Component, { | 14 | exports.ObjectsTray = Montage.create(Component, { |
15 | hideClass : { value: 'hide-objects-tray'}, | 15 | hideClass : { value: 'hide-objects-tray'}, |
16 | _empty : { value: null }, | ||
16 | _workspaceMode : { value: null }, | 17 | _workspaceMode : { value: null }, |
17 | workspaceMode : { | 18 | workspaceMode : { |
18 | get : function() { return this._workspaceMode; }, | 19 | get : function() { return this._workspaceMode; }, |
@@ -76,11 +77,17 @@ exports.ObjectsTray = Montage.create(Component, { | |||
76 | "oneway": true | 77 | "oneway": true |
77 | }); | 78 | }); |
78 | 79 | ||
80 | if(this.objects) { | ||
81 | this.empty = !this.objects.length; | ||
82 | } else { | ||
83 | this.empty = true; | ||
84 | } | ||
85 | |||
79 | } | 86 | } |
80 | }, | 87 | }, |
81 | draw : { | 88 | draw : { |
82 | value: function() { | 89 | value: function() { |
83 | if(this.hide) { | 90 | if(this.hide || this._empty) { |
84 | this.element.classList.add(this.hideClass); | 91 | this.element.classList.add(this.hideClass); |
85 | } else { | 92 | } else { |
86 | this.element.classList.remove(this.hideClass); | 93 | this.element.classList.remove(this.hideClass); |