aboutsummaryrefslogtreecommitdiff
path: root/js/io/workflow/newFileDialog/new-file-workflow-controller.js
diff options
context:
space:
mode:
authorPierre Frisch2011-12-22 07:25:50 -0800
committerValerio Virgillito2012-01-27 11:18:17 -0800
commitb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (patch)
tree0f3136ab0ecdbbbed6a83576581af0a53124d6f1 /js/io/workflow/newFileDialog/new-file-workflow-controller.js
parent2401f05d1f4b94d45e4568b81fc73e67b969d980 (diff)
downloadninja-b89a7ee8b956c96a1dcee995ea840feddc5d4b27.tar.gz
First commit of Ninja to ninja-internal
Signed-off-by: Valerio Virgillito <rmwh84@motorola.com>
Diffstat (limited to 'js/io/workflow/newFileDialog/new-file-workflow-controller.js')
-rw-r--r--js/io/workflow/newFileDialog/new-file-workflow-controller.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/js/io/workflow/newFileDialog/new-file-workflow-controller.js b/js/io/workflow/newFileDialog/new-file-workflow-controller.js
new file mode 100644
index 00000000..5cc68bf9
--- /dev/null
+++ b/js/io/workflow/newFileDialog/new-file-workflow-controller.js
@@ -0,0 +1,59 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
7var Montage = require("montage/core/core").Montage,
8 Popup = require("montage/ui/popup/popup.reel").Popup,
9 newFileOptionsNavigatorModule = require("js/io/workflow/newFileDialog/new-file-options-navigator.reel"),
10 newFileWorkflowModelModule = require("js/io/workflow/newFileDialog/new-file-workflow-model");
11
12//singleton
13exports.NewFileWorkflowController = Montage.create(require("montage/ui/component").Component, {
14 /**
15 * Register a listener for showPicker event
16 */
17 deserializedFromTemplate:{
18 writable:false,
19 enumerable:true,
20 value:function(){
21 var that = this;
22 this.eventManager.addEventListener("executeNewFile", function(evt){
23 that.showNewFileDialog();
24 }, false);
25 }
26 },
27
28 showNewFileDialog:{
29 writable:false,
30 enumerable:true,
31 value:function(){
32 var aModel = null;
33 //render modal dialog
34 var newFileNavContent = document.createElement("div");
35 newFileNavContent.id = "newFileDialog";
36 newFileNavContent.style.width = "650px";
37 newFileNavContent.style.height = "350px";
38 newFileNavContent.style.color = "#fff";
39
40 //elements needs to be on DOM to be drawn
41 document.getElementById('modalContainer').appendChild(newFileNavContent);
42
43 var newFileOptionsNav = newFileOptionsNavigatorModule.NewFileOptionsNavigator.create();
44 newFileOptionsNav.newFileModel = newFileWorkflowModelModule.NewFileWorkflowModel;
45 newFileOptionsNav.element = newFileNavContent;
46
47 //hack - remove after rendering and add in modal dialog
48 document.getElementById('modalContainer').removeChild(newFileNavContent);
49
50 var popup = Popup.create();
51 popup.content = newFileOptionsNav;
52 popup.modal = true;
53 popup.show();
54
55 newFileOptionsNav.popup = popup;//handle to be used for hiding the popup
56
57 }
58 }
59}); \ No newline at end of file