diff options
Diffstat (limited to 'js/stage/binding-view.reel/binding-hud.reel/binding-hud.js')
-rwxr-xr-x | js/stage/binding-view.reel/binding-hud.reel/binding-hud.js | 54 |
1 files changed, 48 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 9918b06d..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 | |||
@@ -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); |
@@ -84,6 +87,45 @@ exports.BindingHud = Montage.create(Component, { | |||
84 | } | 87 | } |
85 | }, | 88 | }, |
86 | 89 | ||
90 | getPropertyList : { | ||
91 | value: function(component) { | ||
92 | var props = this.application.ninja.objectsController.getPropertiesFromObject(component, true), | ||
93 | 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 | } | ||
103 | |||
104 | if(this.userComponent._montage_metadata) { | ||
105 | objectName = this.userComponent._montage_metadata.objectName; | ||
106 | |||
107 | if(this.panelData && this.panelData[objectName + 'Pi']) { | ||
108 | |||
109 | promotedProperties = this.panelData[objectName + 'Pi'][0].Section.map(function(item) { | ||
110 | return item[0].prop; | ||
111 | }); | ||
112 | |||
113 | //// Remove promoted properties from current position in array | ||
114 | props = props.filter(function(prop) { | ||
115 | return promotedProperties.indexOf(prop) === -1; | ||
116 | }); | ||
117 | |||
118 | //// Add them at the top | ||
119 | |||
120 | props = promotedProperties.concat(props); | ||
121 | |||
122 | } | ||
123 | } | ||
124 | |||
125 | return props.map(propertyMapper); | ||
126 | } | ||
127 | }, | ||
128 | |||
87 | properties: { value: [] }, | 129 | properties: { value: [] }, |
88 | 130 | ||
89 | _isResizing: { | 131 | _isResizing: { |
@@ -248,11 +290,11 @@ exports.BindingHud = Montage.create(Component, { | |||
248 | if(direction === "down") { | 290 | if(direction === "down") { |
249 | this.scrollInterval = setInterval(function() { | 291 | this.scrollInterval = setInterval(function() { |
250 | this.optionsRepeater.element.scrollTop += 3; | 292 | this.optionsRepeater.element.scrollTop += 3; |
251 | }.bind(this), 50); | 293 | }.bind(this), 20); |
252 | } else { | 294 | } else { |
253 | this.scrollInterval = setInterval(function() { | 295 | this.scrollInterval = setInterval(function() { |
254 | this.optionsRepeater.element.scrollTop -= 3; | 296 | this.optionsRepeater.element.scrollTop -= 3; |
255 | }.bind(this), 50); | 297 | }.bind(this), 20); |
256 | } | 298 | } |
257 | } | 299 | } |
258 | } | 300 | } |
@@ -267,11 +309,11 @@ exports.BindingHud = Montage.create(Component, { | |||
267 | //e._event.target.parentElement.controller.currentScrollDirection = "down"; | 309 | //e._event.target.parentElement.controller.currentScrollDirection = "down"; |
268 | this.scrollInterval = setInterval(function() { | 310 | this.scrollInterval = setInterval(function() { |
269 | self.optionsRepeater.element.scrollTop += 3; | 311 | self.optionsRepeater.element.scrollTop += 3; |
270 | }, 50); | 312 | }, 20); |
271 | } else { | 313 | } else { |
272 | this.scrollInterval = setInterval(function() { | 314 | this.scrollInterval = setInterval(function() { |
273 | self.optionsRepeater.element.scrollTop -= 3; | 315 | self.optionsRepeater.element.scrollTop -= 3; |
274 | }, 50); | 316 | }, 20); |
275 | } | 317 | } |
276 | } | 318 | } |
277 | } | 319 | } |