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 | 63 |
1 files changed, 32 insertions, 31 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 a62fe78d..1b0af09d 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 | |||
@@ -10,6 +10,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
10 | */ | 10 | */ |
11 | var Montage = require("montage/core/core").Montage, | 11 | var Montage = require("montage/core/core").Montage, |
12 | Component = require("montage/ui/component").Component; | 12 | Component = require("montage/ui/component").Component; |
13 | var ElementsMediator = require("js/mediators/element-mediator").ElementMediator; | ||
13 | 14 | ||
14 | exports.BindingHud = Montage.create(Component, { | 15 | exports.BindingHud = Montage.create(Component, { |
15 | scrollUp: { | 16 | scrollUp: { |
@@ -49,10 +50,10 @@ exports.BindingHud = Montage.create(Component, { | |||
49 | value: null, | 50 | value: null, |
50 | serializable: true | 51 | serializable: true |
51 | }, | 52 | }, |
52 | _userComponent: { value: null }, | 53 | _userElement: { value: null }, |
53 | userComponent: { | 54 | userElement: { |
54 | get: function() { | 55 | get: function() { |
55 | return this._userComponent; | 56 | return this._userElement; |
56 | }, | 57 | }, |
57 | set: function(val) { | 58 | set: function(val) { |
58 | if(!val) { return; } | 59 | if(!val) { return; } |
@@ -61,14 +62,14 @@ exports.BindingHud = Montage.create(Component, { | |||
61 | bindingView = this.parentComponent.parentComponent, | 62 | bindingView = this.parentComponent.parentComponent, |
62 | isOffStage, icon, iconOffsets; | 63 | isOffStage, icon, iconOffsets; |
63 | 64 | ||
64 | this._userComponent = val; | 65 | this._userElement = val; |
65 | this.properties = this.getPropertyList(val); //controller.getPropertiesFromObject(val, true); | 66 | this.properties = this.getPropertyList(val.controller); //controller.getPropertiesFromObject(val, true); |
66 | 67 | ||
67 | controller.getObjectBindings(this.userComponent).forEach(function(obj) { | 68 | controller.getObjectBindings(this._userElement.controller).forEach(function(obj) { |
68 | this.boundProperties.push(obj.sourceObjectPropertyPath); | 69 | this.boundProperties.push(obj.sourceObjectPropertyPath); |
69 | }, this); | 70 | }, this); |
70 | 71 | ||
71 | isOffStage = controller.isOffStageObject(val); | 72 | isOffStage = controller.isOffStageObject(val.controller); |
72 | 73 | ||
73 | if(isOffStage) { | 74 | if(isOffStage) { |
74 | icon = bindingView.getOffStageIcon(val); | 75 | icon = bindingView.getOffStageIcon(val); |
@@ -77,13 +78,13 @@ exports.BindingHud = Montage.create(Component, { | |||
77 | this.x = iconOffsets.x; | 78 | this.x = iconOffsets.x; |
78 | this.y = iconOffsets.y - 80; | 79 | this.y = iconOffsets.y - 80; |
79 | } else { | 80 | } else { |
80 | this.title = val.identifier; | 81 | this.title = this._userElement.controller.identifier; |
81 | this.x = val.element.offsetLeft; | 82 | this.x = this._userElement.offsetLeft; |
82 | this.y = val.element.offsetTop; | 83 | this.y = this._userElement.offsetTop; |
84 | // this.x = parseInt(ElementsMediator.getProperty(val, "left")); | ||
85 | // this.y = parseInt(ElementsMediator.getProperty(val, "top")); | ||
83 | } | 86 | } |
84 | |||
85 | this.needsDraw = true; | 87 | this.needsDraw = true; |
86 | |||
87 | } | 88 | } |
88 | }, | 89 | }, |
89 | 90 | ||
@@ -101,8 +102,8 @@ exports.BindingHud = Montage.create(Component, { | |||
101 | } | 102 | } |
102 | } | 103 | } |
103 | 104 | ||
104 | if(this.userComponent._montage_metadata) { | 105 | if(this.userElement.controller._montage_metadata) { |
105 | objectName = this.userComponent._montage_metadata.objectName; | 106 | objectName = this.userElement.controller._montage_metadata.objectName; |
106 | 107 | ||
107 | if(this.panelData && this.panelData[objectName + 'Pi']) { | 108 | if(this.panelData && this.panelData[objectName + 'Pi']) { |
108 | 109 | ||
@@ -302,22 +303,17 @@ exports.BindingHud = Montage.create(Component, { | |||
302 | 303 | ||
303 | handleMouseover: { | 304 | handleMouseover: { |
304 | value: function(e) { | 305 | value: function(e) { |
306 | |||
305 | if(this.scrollSpace < this.properties.length) { | 307 | if(this.scrollSpace < this.properties.length) { |
306 | if (this.scrollInterval === null) { | 308 | if (this.scrollInterval === null) { |
307 | if (e._event.target.classList.contains("scrollAreaBottom")) { | 309 | if (e._event.target.classList.contains("scrollAreaBottom")) { |
308 | self = e._event.target.parentElement.controller; | 310 | this.currentScrollDirection = "down"; |
309 | //e._event.target.parentElement.controller.currentScrollDirection = "down"; | ||
310 | this.scrollInterval = setInterval(function() { | ||
311 | self.optionsRepeater.element.scrollTop += 3; | ||
312 | }, 20); | ||
313 | } else { | 311 | } else { |
314 | this.scrollInterval = setInterval(function() { | 312 | this.currentScrollDirection = "up"; |
315 | self.optionsRepeater.element.scrollTop -= 3; | ||
316 | }, 20); | ||
317 | } | 313 | } |
318 | } | 314 | } |
319 | } | 315 | } |
320 | //this.needsDraw = true; | 316 | this.needsDraw = true; |
321 | } | 317 | } |
322 | }, | 318 | }, |
323 | 319 | ||
@@ -333,17 +329,22 @@ exports.BindingHud = Montage.create(Component, { | |||
333 | 329 | ||
334 | draw: { | 330 | draw: { |
335 | value: function() { | 331 | value: function() { |
332 | |||
333 | if(this.currentScrollDirection !== null) { | ||
334 | this.scrollInterval = setInterval(function() { | ||
335 | if(this.currentScrollDirection === "down") { | ||
336 | this.optionsRepeater.element.scrollTop += 3; | ||
337 | } else { | ||
338 | this.optionsRepeater.element.scrollTop -= 3; | ||
339 | } | ||
340 | }.bind(this), 20); | ||
341 | } else { | ||
342 | clearInterval(this.scrollInterval); | ||
343 | } | ||
344 | |||
336 | this.titleElement.innerHTML = this.title; | 345 | this.titleElement.innerHTML = this.title; |
337 | this.element.style.top = (this.y + this._resizedY) + "px"; | 346 | this.element.style.top = (this.y + this._resizedY) + "px"; |
338 | this.element.style.left = (this.x + this._resizedX) + "px"; | 347 | this.element.style.left = (this.x + this._resizedX) + "px"; |
339 | |||
340 | // if(this.currentScrollDirection !== null) { | ||
341 | // if(this.currentScrollDirection === "up") { | ||
342 | // this.optionsRepeater.element.scrollTop -= 18; | ||
343 | // } else { | ||
344 | // this.optionsRepeater.element.scrollTop += 18; | ||
345 | // } | ||
346 | // } | ||
347 | } | 348 | } |
348 | }, | 349 | }, |
349 | didDraw: { | 350 | didDraw: { |