aboutsummaryrefslogtreecommitdiff
path: root/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-27 15:38:33 -0700
committerArmen Kesablyan2012-06-27 15:38:33 -0700
commit8eb74d31d3c9ac60d48312d8774fd02cad0c77af (patch)
treeae79629cedf9f683d77749a25988060ab9623216 /js/stage/binding-view.reel/binding-hud.reel/binding-hud.js
parentec6759f9821a5647905617e3992fdda1cea390ef (diff)
parent61a41e74154715b0b42a429158fa1f2a44d2eb9a (diff)
downloadninja-8eb74d31d3c9ac60d48312d8774fd02cad0c77af.tar.gz
Merge branch 'Bindables_GIO' of https://github.com/ericguzman/ninja-internal
Diffstat (limited to 'js/stage/binding-view.reel/binding-hud.reel/binding-hud.js')
-rwxr-xr-xjs/stage/binding-view.reel/binding-hud.reel/binding-hud.js46
1 files changed, 40 insertions, 6 deletions
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 85e4b87b..6b802cb0 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
@@ -45,7 +45,10 @@ exports.BindingHud = Montage.create(Component, {
45 optionsRepeater: { 45 optionsRepeater: {
46 value: null 46 value: null
47 }, 47 },
48 48 panelData : {
49 value: null,
50 serializable: true
51 },
49 _userComponent: { value: null }, 52 _userComponent: { value: null },
50 userComponent: { 53 userComponent: {
51 get: function() { 54 get: function() {
@@ -59,7 +62,7 @@ exports.BindingHud = Montage.create(Component, {
59 isOffStage, icon, iconOffsets; 62 isOffStage, icon, iconOffsets;
60 63
61 this._userComponent = val; 64 this._userComponent = val;
62 this.properties = controller.getPropertiesFromObject(val, true); 65 this.properties = this.getPropertyList(val); //controller.getPropertiesFromObject(val, true);
63 66
64 controller.getObjectBindings(this.userComponent).forEach(function(obj) { 67 controller.getObjectBindings(this.userComponent).forEach(function(obj) {
65 this.boundProperties.push(obj.sourceObjectPropertyPath); 68 this.boundProperties.push(obj.sourceObjectPropertyPath);
@@ -79,6 +82,37 @@ exports.BindingHud = Montage.create(Component, {
79 } 82 }
80 }, 83 },
81 84
85 getPropertyList : {
86 value: function(component) {
87 var props = this.application.ninja.objectsController.getPropertiesFromObject(component, true);
88
89 var objectName, promotedProperties;
90
91 if(this.userComponent._montage_metadata) {
92 objectName = this.userComponent._montage_metadata.objectName;
93
94 if(this.panelData && this.panelData[objectName + 'Pi']) {
95
96 promotedProperties = this.panelData[objectName + 'Pi'][0].Section.map(function(item) {
97 return item[0].prop;
98 });
99
100 //// Remove promoted properties from current position in array
101 props = props.filter(function(prop) {
102 return promotedProperties.indexOf(prop) === -1;
103 });
104
105 //// Add them at the top
106
107 props = promotedProperties.concat(props);
108
109 }
110 }
111
112 return props;
113 }
114 },
115
82 properties: { value: [] }, 116 properties: { value: [] },
83 117
84 _isResizing: { 118 _isResizing: {
@@ -249,11 +283,11 @@ exports.BindingHud = Montage.create(Component, {
249 if(direction === "down") { 283 if(direction === "down") {
250 this.scrollInterval = setInterval(function() { 284 this.scrollInterval = setInterval(function() {
251 this.optionsRepeater.element.scrollTop += 3; 285 this.optionsRepeater.element.scrollTop += 3;
252 }.bind(this), 50); 286 }.bind(this), 20);
253 } else { 287 } else {
254 this.scrollInterval = setInterval(function() { 288 this.scrollInterval = setInterval(function() {
255 this.optionsRepeater.element.scrollTop -= 3; 289 this.optionsRepeater.element.scrollTop -= 3;
256 }.bind(this), 50); 290 }.bind(this), 20);
257 } 291 }
258 } 292 }
259 } 293 }
@@ -268,11 +302,11 @@ exports.BindingHud = Montage.create(Component, {
268 //e._event.target.parentElement.controller.currentScrollDirection = "down"; 302 //e._event.target.parentElement.controller.currentScrollDirection = "down";
269 this.scrollInterval = setInterval(function() { 303 this.scrollInterval = setInterval(function() {
270 self.optionsRepeater.element.scrollTop += 3; 304 self.optionsRepeater.element.scrollTop += 3;
271 }, 50); 305 }, 20);
272 } else { 306 } else {
273 this.scrollInterval = setInterval(function() { 307 this.scrollInterval = setInterval(function() {
274 self.optionsRepeater.element.scrollTop -= 3; 308 self.optionsRepeater.element.scrollTop -= 3;
275 }, 50); 309 }, 20);
276 } 310 }
277 } 311 }
278 } 312 }