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 | 89 |
1 files changed, 89 insertions, 0 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 new file mode 100755 index 00000000..acd072f9 --- /dev/null +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js | |||
@@ -0,0 +1,89 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | /** | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | */ | ||
11 | var Montage = require("montage/core/core").Montage, | ||
12 | Component = require("montage/ui/component").Component; | ||
13 | |||
14 | exports.BindingHud = Montage.create(Component, { | ||
15 | _bindingArgs: { | ||
16 | value: null | ||
17 | }, | ||
18 | |||
19 | titleElement: { | ||
20 | value: null | ||
21 | }, | ||
22 | |||
23 | bindingArgs: { | ||
24 | get: function() { | ||
25 | return this._bindingArgs; | ||
26 | }, | ||
27 | set: function(val) { | ||
28 | if (typeof(val) !== "undefined") { | ||
29 | this._bindingArgs = val; | ||
30 | this.title = this.bindingArgs.component.identifier; | ||
31 | this.x = this._bindingArgs.component.element.offsetLeft; | ||
32 | this.y = this._bindingArgs.component.element.offsetTop; | ||
33 | this.properties = this._bindingArgs.properties; | ||
34 | this.needsDraw = true; | ||
35 | console.log("Binding Args Set", val); | ||
36 | } else { | ||
37 | this.properties = []; | ||
38 | } | ||
39 | } | ||
40 | }, | ||
41 | |||
42 | properties: { | ||
43 | value: [ | ||
44 | ] | ||
45 | }, | ||
46 | |||
47 | x: { | ||
48 | value: 20 | ||
49 | }, | ||
50 | |||
51 | y: { | ||
52 | value: 100 | ||
53 | }, | ||
54 | |||
55 | _title: { | ||
56 | value: "default" | ||
57 | }, | ||
58 | |||
59 | title: { | ||
60 | get: function() { | ||
61 | return this._title; | ||
62 | }, | ||
63 | set: function(val) { | ||
64 | this._title = val; | ||
65 | } | ||
66 | }, | ||
67 | |||
68 | prepareForDraw: { | ||
69 | value: function() { | ||
70 | // var arrProperties = this.application.ninja.objectsController.getEnumerableProperties(this._bindingArgs.sourceObject, true); | ||
71 | // arrProperties.forEach(function(obj) { | ||
72 | // var objBound = false; | ||
73 | // if(this._bindingArgs._boundObjectPropertyPath === obj) { | ||
74 | // objBound = true; | ||
75 | // } | ||
76 | // this.properties.push({"title":obj, "bound": objBound}); | ||
77 | // }.bind(this)); | ||
78 | } | ||
79 | }, | ||
80 | |||
81 | draw: { | ||
82 | value: function() { | ||
83 | this.titleElement.innerHTML = this.title; | ||
84 | this.element.style.top = this.y + "px"; | ||
85 | this.element.style.left = this.x + "px"; | ||
86 | console.log("hud",this); | ||
87 | } | ||
88 | } | ||
89 | }); \ No newline at end of file | ||