diff options
-rwxr-xr-x | js/ninja.reel/ninja.js | 2 | ||||
-rwxr-xr-x | js/stage/binding-view.reel/binding-hud.reel/binding-hud.js | 63 | ||||
-rwxr-xr-x | js/stage/binding-view.reel/binding-view.html | 2 | ||||
-rwxr-xr-x | js/stage/binding-view.reel/binding-view.js | 38 | ||||
-rw-r--r-- | js/tools/bindingTool.js | 20 |
5 files changed, 62 insertions, 63 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 859268a0..9942300c 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js | |||
@@ -519,10 +519,12 @@ exports.Ninja = Montage.create(Component, { | |||
519 | // background = "#000000"; | 519 | // background = "#000000"; |
520 | // overflow = "hidden"; | 520 | // overflow = "hidden"; |
521 | transitionStopRule = "nj-css-garbage-selector"; | 521 | transitionStopRule = "nj-css-garbage-selector"; |
522 | this.stage.bindingView.hide = true; | ||
522 | } else { | 523 | } else { |
523 | // background = "#808080"; | 524 | // background = "#808080"; |
524 | // overflow = "visible"; | 525 | // overflow = "visible"; |
525 | transitionStopRule = "*" | 526 | transitionStopRule = "*" |
527 | this.stage.bindingView.hide = false; | ||
526 | } | 528 | } |
527 | 529 | ||
528 | // TODO: Remove marker for old template: NINJA-STAGE-REWORK | 530 | // TODO: Remove marker for old template: NINJA-STAGE-REWORK |
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: { |
diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html index b6c5ff40..c8da1e7e 100755 --- a/js/stage/binding-view.reel/binding-view.html +++ b/js/stage/binding-view.reel/binding-view.html | |||
@@ -41,7 +41,7 @@ | |||
41 | "panelData": {"@": "panelData"} | 41 | "panelData": {"@": "panelData"} |
42 | }, | 42 | }, |
43 | "bindings": { | 43 | "bindings": { |
44 | "userComponent": {"<-": "@hudRepeater.objectAtCurrentIteration"} | 44 | "userElement": {"<-": "@hudRepeater.objectAtCurrentIteration"} |
45 | }, | 45 | }, |
46 | "listeners": [ | 46 | "listeners": [ |
47 | { | 47 | { |
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index 1fc4d583..9e1b3e22 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js | |||
@@ -97,20 +97,20 @@ exports.BindingView = Montage.create(Component, { | |||
97 | } | 97 | } |
98 | }, | 98 | }, |
99 | 99 | ||
100 | _selectedComponent: { value: null }, | 100 | _selectedElement: { value: null }, |
101 | selectedComponent: { | 101 | selectedElement: { |
102 | get: function() { | 102 | get: function() { |
103 | return this._selectedComponent; | 103 | return this._selectedElement; |
104 | }, | 104 | }, |
105 | set: function(val) { | 105 | set: function(val) { |
106 | this.boundComponents = []; | 106 | this.boundComponents = []; |
107 | if(this._selectedComponent !== val) { | 107 | if(this._selectedElement !== val) { |
108 | this.clearCanvas(); | 108 | this.cle |