diff options
Diffstat (limited to 'node_modules/montage-user/ui/substitution.reel/substitution.js')
-rwxr-xr-x | node_modules/montage-user/ui/substitution.reel/substitution.js | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/node_modules/montage-user/ui/substitution.reel/substitution.js b/node_modules/montage-user/ui/substitution.reel/substitution.js new file mode 100755 index 00000000..ad4034c1 --- /dev/null +++ b/node_modules/montage-user/ui/substitution.reel/substitution.js | |||
@@ -0,0 +1,91 @@ | |||
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 | @module "montage/ui/substitution.reel" | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | @requires montage/ui/slot | ||
11 | @requires core/logger | ||
12 | */ | ||
13 | var Montage = require("montage").Montage, | ||
14 | Component = require("ui/component").Component, | ||
15 | Slot = require("ui/slot.reel").Slot, | ||
16 | logger = require("core/logger").logger("substitution"); | ||
17 | /** | ||
18 | @class module:"montage/ui/substitution.reel".Substitution | ||
19 | */ | ||
20 | exports.Substitution = Montage.create(Slot, /** @lends module:"montage/ui/substitution.reel".Substitution# */ { | ||
21 | |||
22 | hasTemplate: { | ||
23 | enumerable: false, | ||
24 | value: false | ||
25 | }, | ||
26 | /** | ||
27 | Description TODO | ||
28 | @type {Property} | ||
29 | @default {} | ||
30 | */ | ||
31 | switchComponents: { | ||
32 | enumerable: false, | ||
33 | serializable: true, | ||
34 | distinct: true, | ||
35 | value: {} | ||
36 | }, | ||
37 | /** | ||
38 | Description TODO | ||
39 | @private | ||
40 | */ | ||
41 | _switchValue: { | ||
42 | enumerable: false, | ||
43 | value: null | ||
44 | }, | ||
45 | /** | ||
46 | Description TODO | ||
47 | @type {Function} | ||
48 | @default null | ||
49 | */ | ||
50 | switchValue: { | ||
51 | enumerable: false, | ||
52 | get: function() { | ||
53 | return this._switchValue; | ||
54 | }, | ||
55 | set: function(value) { | ||
56 | |||
57 | if (this._switchValue === value || this._isSwitchingContent) { | ||
58 | return; | ||
59 | } | ||
60 | |||
61 | this._switchValue = value; | ||
62 | |||
63 | if (this.switchComponents) { | ||
64 | this.content = this.switchComponents[this.switchValue]; | ||
65 | } | ||
66 | } | ||
67 | }, | ||
68 | /** | ||
69 | Description TODO | ||
70 | @type {Property} | ||
71 | @default null | ||
72 | */ | ||
73 | transition: { | ||
74 | enumerable: false, | ||
75 | value: null | ||
76 | }, | ||
77 | /** | ||
78 | Description TODO | ||
79 | @function | ||
80 | */ | ||
81 | prepareForDraw: { | ||
82 | enumerable: false, | ||
83 | value: function() { | ||
84 | |||
85 | if (this.switchComponents) { | ||
86 | this.content = this.switchComponents[this.switchValue]; | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | |||
91 | }); | ||