aboutsummaryrefslogtreecommitdiff
path: root/js/io/workflow/newFileDialog/new-file-workflow-controller.js
diff options
context:
space:
mode:
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