aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorEric Guzman2012-06-28 11:00:18 -0700
committerEric Guzman2012-06-28 11:00:18 -0700
commite1f83a2c603bf9ddb74889f7ba5b697bb474edaa (patch)
tree07cab501293aa91637ac0bb8fd158225b6d13032 /js
parent61a41e74154715b0b42a429158fa1f2a44d2eb9a (diff)
downloadninja-e1f83a2c603bf9ddb74889f7ba5b697bb474edaa.tar.gz
Binding HUD - Updated CSS for hud and promoted/bound properties.
Diffstat (limited to 'js')
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js30
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud.reel/binding-hud.css16
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud.reel/binding-hud.html3
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud.reel/binding-hud.js16
4 files changed, 55 insertions, 10 deletions
diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js
index fb0fd57e..a7fbb297 100755
--- a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js
+++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js
@@ -26,8 +26,28 @@ exports.BindingHudOption = Montage.create(Component, {
26 } 26 }
27 }, 27 },
28 28
29 bound: { 29 _promoted : { value: null },
30 value: false 30 promoted : {
31 get : function() { return this._promoted; },
32 set : function(value) {
33 if(value === this._promoted) { return; }
34
35 this._promoted = value;
36
37 this.needsDraw = true;
38 }
39 },
40
41 _bound : { value: null },
42 bound : {
43 get : function() { return this._bound; },
44 set : function(value) {
45 if(value === this._bound) { return; }
46
47 this._bound = value;
48
49 this.needsDraw = true;
50 }
31 }, 51 },
32 52
33 prepareForDraw: { 53 prepareForDraw: {
@@ -47,6 +67,12 @@ exports.BindingHudOption = Montage.create(Component, {
47 } else { 67 } else {
48 this.element.classList.remove("bound"); 68 this.element.classList.remove("bound");
49 } 69 }
70
71 if(this.promoted || this.bound) {
72 this.element.classList.add("promoted");
73 } else {
74 this.element.classList.remove("promoted");
75 }
50// if(this.bindings.length > 0) { 76// if(this.bindings.length > 0) {
51// this.element.classList.add("bound"); 77// this.element.classList.add("bound");
52// } else { 78// } else {
diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css
index 5818eca8..1536c706 100755
--- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css
+++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css
@@ -11,7 +11,7 @@
11 font-size: 11px; 11 font-size: 11px;
12 box-shadow: 3px 3px 20px rgba(0, 0, 0, 0.61); 12 box-shadow: 3px 3px 20px rgba(0, 0, 0, 0.61);
13 border-radius: 6px; 13 border-radius: 6px;
14 padding: 3px 8px; 14 padding: 3px;
15 text-shadow: 1px 1px 0px #000; 15 text-shadow: 1px 1px 0px #000;
16} 16}
17 17
@@ -29,6 +29,8 @@
29 /*background: rgba(0, 0, 0, 0.3);*/ 29 /*background: rgba(0, 0, 0, 0.3);*/
30 line-height:16px; 30 line-height:16px;
31 /*box-shadow: inset 0px 0px 4px #333, 1px 1px 0px #3A3A3A;*/ 31 /*box-shadow: inset 0px 0px 4px #333, 1px 1px 0px #3A3A3A;*/
32 padding-top: 4px;
33 margin: 0 5px;
32 min-width: 80px; 34 min-width: 80px;
33} 35}
34 36
@@ -38,7 +40,10 @@
38 line-height:16px; 40 line-height:16px;
39 padding:1px 25px 1px 8px; 41 padding:1px 25px 1px 8px;
40} 42}
41 43.bindingHud .hudOption.promoted {
44 color: #FFF;
45 font-weight: bold;
46}
42.bindingHud .hudOption .connectorBubble:hover { 47.bindingHud .hudOption .connectorBubble:hover {
43 background-color: #1B52A7; 48 background-color: #1B52A7;
44 box-shadow: inset 0px 2px 2px 1px rgba(15, 15, 15, 0.78), 0 1px #474747; 49 box-shadow: inset 0px 2px 2px 1px rgba(15, 15, 15, 0.78), 0 1px #474747;
@@ -94,8 +99,13 @@
94} 99}
95.splitter.scrollArea:hover:not(.disabled) { 100.splitter.scrollArea:hover:not(.disabled) {
96 background-color: #303030; 101 background-color: #303030;
102 border-bottom: 1px solid #252525;
103 box-shadow: 0 1px 0 0 #3F3F3F;
104}
105.splitter.scrollAreaBottom:hover:not(.disabled) {
106 border-bottom: 1px solid #3F3F3F;
107 box-shadow: 0 1px 0 0 #252525;
97} 108}
98
99 109
100.hudRepetition { 110.hudRepetition {
101 overflow: hidden; 111 overflow: hidden;
diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
index 7bb888d5..f7e1a1d2 100755
--- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
+++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html
@@ -36,7 +36,8 @@
36 "element": {"#" : "hudOption"} 36 "element": {"#" : "hudOption"}
37 }, 37 },
38 "bindings": { 38 "bindings": {
39 "title": {"<-": "@repeater.objectAtCurrentIteration"} 39 "title": {"<-": "@repeater.objectAtCurrentIteration.property"},
40 "promoted": {"<-": "@repeater.objectAtCurrentIteration.promoted"}
40 } 41 }
41 }, 42 },
42 "resizer1": { 43 "resizer1": {
diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js
index 0f1b99c9..a62fe78d 100755
--- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js
+++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js
@@ -89,9 +89,17 @@ exports.BindingHud = Montage.create(Component, {
89 89
90 getPropertyList : { 90 getPropertyList : {
91 value: function(component) { 91 value: function(component) {
92 var props = this.application.ninja.objectsController.getPropertiesFromObject(component, true); 92 var props = this.application.ninja.objectsController.getPropertiesFromObject(component, true),
93 93 promotedProperties = [],
94 var objectName, promotedProperties; 94 objectName;
95
96 ///// Mapper - property to property object
97 function propertyMapper(property) {
98 return {
99 property: property,
100 promoted: promotedProperties.indexOf(property) !== -1
101 }
102 }
95 103
96 if(this.userComponent._montage_metadata) { 104 if(this.userComponent._montage_metadata) {
97 objectName = this.userComponent._montage_metadata.objectName; 105 objectName = this.userComponent._montage_metadata.objectName;
@@ -114,7 +122,7 @@ exports.BindingHud = Montage.create(Component, {
114 } 122 }
115 } 123 }
116 124
117 return props; 125 return props.map(propertyMapper);
118 } 126 }
119 }, 127 },
120 128