diff options
author | Eric Guzman | 2012-06-27 10:32:47 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-27 10:32:47 -0700 |
commit | 58f1de4f1cb0f59abd47cec4430a032c073f85e9 (patch) | |
tree | a6c2af9be68e6881311074bd3c8cc461deee7203 /js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js | |
parent | a72b6809e214eb524f866440a55f8366f078c240 (diff) | |
parent | 2ebf3e3ea24d0d580575dfa13d31588dac1de445 (diff) | |
download | ninja-58f1de4f1cb0f59abd47cec4430a032c073f85e9.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into CSSPanel_GIO
Diffstat (limited to 'js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js')
-rwxr-xr-x | js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js new file mode 100755 index 00000000..fb0fd57e --- /dev/null +++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js | |||
@@ -0,0 +1,57 @@ | |||
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.BindingHudOption = Montage.create(Component, { | ||
15 | _title: { | ||
16 | value: null | ||
17 | }, | ||
18 | |||
19 | title: { | ||
20 | get: function() { | ||
21 | return this._title; | ||
22 | }, | ||
23 | set: function(val) { | ||
24 | this._title = val; | ||
25 | this.needsDraw = true; | ||
26 | } | ||
27 | }, | ||
28 | |||
29 | bound: { | ||
30 | value: false | ||
31 | }, | ||
32 | |||
33 | prepareForDraw: { | ||
34 | value: function() { | ||
35 | // Set Up Listener for click and propagate up to Binding View | ||
36 | var matchesBound = this.parentComponent.parentComponent.boundProperties.filter(function(obj) { | ||
37 | return (obj === this.title); | ||
38 | }.bind(this)); | ||
39 | if(matchesBound.length > 0) this.bound = true; | ||
40 | } | ||
41 | }, | ||
42 | |||
43 | draw: { | ||
44 | value:function() { | ||
45 | if(this.bound) { | ||
46 | this.element.classList.add("bound"); | ||
47 | } else { | ||
48 | this.element.classList.remove("bound"); | ||
49 | } | ||
50 | // if(this.bindings.length > 0) { | ||
51 | // this.element.classList.add("bound"); | ||
52 | // } else { | ||
53 | // this.element.classList.remove("bound"); | ||
54 | // } | ||
55 | } | ||
56 | } | ||
57 | }); \ No newline at end of file | ||