diff options
author | Pierre Frisch | 2011-12-22 07:25:50 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-01-27 11:18:17 -0800 |
commit | b89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch) | |
tree | 0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/components/ui/modalDialog/modalDialogHeader.js | |
parent | 2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff) | |
download | ninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz |
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/components/ui/modalDialog/modalDialogHeader.js')
-rw-r--r-- | js/components/ui/modalDialog/modalDialogHeader.js | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/js/components/ui/modalDialog/modalDialogHeader.js b/js/components/ui/modalDialog/modalDialogHeader.js new file mode 100644 index 00000000..6770f60a --- /dev/null +++ b/js/components/ui/modalDialog/modalDialogHeader.js | |||
@@ -0,0 +1,82 @@ | |||
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 | var Component = require("montage/ui/component").Component; | ||
9 | |||
10 | var modalDialogManagerModule = require("js/components/ui/modalDialog/modal-dialog-manager"); | ||
11 | |||
12 | var ModalDialogHeader = exports.ModalDialogHeader = Montage.create(Component, { | ||
13 | |||
14 | _firstTime: { | ||
15 | enumerable: false, | ||
16 | value: true | ||
17 | }, | ||
18 | |||
19 | showTitle:{ | ||
20 | enumerable: true, | ||
21 | value: true | ||
22 | }, | ||
23 | |||
24 | title:{ | ||
25 | enumerable : true, | ||
26 | value: "Default Title" | ||
27 | }, | ||
28 | |||
29 | showClose:{ | ||
30 | enumerable: true, | ||
31 | value: true | ||
32 | }, | ||
33 | |||
34 | willDraw: { | ||
35 | enumerable: false, | ||
36 | value: function() { | ||
37 | |||
38 | } | ||
39 | }, | ||
40 | |||
41 | draw: { | ||
42 | enumerable: false, | ||
43 | value: function() { | ||
44 | var closeElement = this.cross; | ||
45 | if(closeElement){ | ||
46 | if(!this.showClose){ | ||
47 | closeElement.style.visibility = "hidden"; | ||
48 | }else{ | ||
49 | closeElement.addEventListener("click", function(){ | ||
50 | modalDialogManagerModule.ModalDialogMananger.closeModalDialog(); | ||
51 | }, false); | ||
52 | } | ||
53 | } | ||
54 | var titleElement = this.title; | ||
55 | if(titleElement){ | ||
56 | if(this.showTitle){ | ||
57 | titleElement.innerHTML = this.title; | ||
58 | }else{ | ||
59 | titleElement.style.visibility = "hidden"; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | if(!this.showClose){ | ||
64 | closeElement.style.display = "none"; | ||
65 | } | ||
66 | if(!this.showTitle){ | ||
67 | this.separator.style.display = "none"; | ||
68 | } | ||
69 | |||
70 | this.element.parentNode.addEventListener("closeDialog", function(evt){ | ||
71 | modalDialogManagerModule.ModalDialogMananger.closeModalDialog(); | ||
72 | }, false); | ||
73 | } | ||
74 | }, | ||
75 | |||
76 | didDraw: { | ||
77 | enumerable: false, | ||
78 | value: function() { | ||
79 | |||
80 | } | ||
81 | } | ||
82 | }); \ No newline at end of file | ||