diff options
author | Valerio Virgillito | 2012-03-15 16:28:39 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-15 16:28:39 -0700 |
commit | bb6449a3a2adcbc1d109a042e4ee23e7b2614821 (patch) | |
tree | 9d7a8eb7e1bb06f5402117315e61218b74cc105f /js/components/focus-manager.reel | |
parent | db59414f48d79f8f959dcc105cfaf616268ca235 (diff) | |
parent | 1d0a4ae3e1a051c7cf1ac02ebbc03f48d1cdfb6c (diff) | |
download | ninja-bb6449a3a2adcbc1d109a042e4ee23e7b2614821.tar.gz |
Merge pull request #118 from mencio/pi-fixes
Fixed issues with Properties panel, focus and grid redraw
Diffstat (limited to 'js/components/focus-manager.reel')
-rw-r--r-- | js/components/focus-manager.reel/focus-manager.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/js/components/focus-manager.reel/focus-manager.js b/js/components/focus-manager.reel/focus-manager.js new file mode 100644 index 00000000..65a84bc1 --- /dev/null +++ b/js/components/focus-manager.reel/focus-manager.js | |||
@@ -0,0 +1,49 @@ | |||
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 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | exports.FocusManager = Montage.create(Component, { | ||
11 | |||
12 | hasTemplate: { | ||
13 | value: false | ||
14 | }, | ||
15 | |||
16 | element: { | ||
17 | serializable: true, | ||
18 | enumerable: true, | ||
19 | get: function() { | ||
20 | return this._element; | ||
21 | }, | ||
22 | set: function(value) { | ||
23 | // call super set | ||
24 | Object.getPropertyDescriptor(Component, "element").set.call(this, value); | ||
25 | } | ||
26 | }, | ||
27 | |||
28 | hiddenInput: { | ||
29 | value: null | ||
30 | }, | ||
31 | |||
32 | prepareForDraw: { | ||
33 | value: function() { | ||
34 | this.hiddenInput = document.createElement("input"); | ||
35 | this.hiddenInput.type = "text"; | ||
36 | |||
37 | this.element.appendChild(this.hiddenInput); | ||
38 | |||
39 | } | ||
40 | }, | ||
41 | |||
42 | setFocus: { | ||
43 | value: function() { | ||
44 | this.hiddenInput.focus(); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | }); | ||
49 | |||