aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-03-22 10:43:54 -0700
committerAnanya Sen2012-03-22 10:43:54 -0700
commit5b0ff2b7347d158876c366c51988a94570dda18b (patch)
tree52d4238267fdeb5a9ebe532fc6c1fbd07cabfdd3 /js
parent85bf9f937fa2ec46e42f791fc6815f7c2f5446ea (diff)
downloadninja-5b0ff2b7347d158876c366c51988a94570dda18b.tar.gz
IKNINJA-1302 : more fix
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js1
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js7
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js39
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js5
4 files changed, 26 insertions, 26 deletions
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
index 651fd7fa..ccb925b9 100755
--- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
+++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js
@@ -69,6 +69,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, {
69 var newFileDirectorySetEvent = document.createEvent("Events"); 69 var newFileDirectorySetEvent = document.createEvent("Events");
70 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); 70 newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false);
71 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; 71 newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value;
72 newFileDirectorySetEvent.keyCode = evt.keyCode;
72 this.eventManager.dispatchEvent(newFileDirectorySetEvent); 73 this.eventManager.dispatchEvent(newFileDirectorySetEvent);
73 } 74 }
74 } 75 }
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index c4b7ea99..811231e4 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -32,14 +32,9 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
32 var newFileNameSetEvent = document.createEvent("Events"); 32 var newFileNameSetEvent = document.createEvent("Events");
33 newFileNameSetEvent.initEvent("newFileNameSet", false, false); 33 newFileNameSetEvent.initEvent("newFileNameSet", false, false);
34 newFileNameSetEvent.newFileName = this.newFileName.value; 34 newFileNameSetEvent.newFileName = this.newFileName.value;
35 newFileNameSetEvent.keyCode = evt.keyCode;
35 this.eventManager.dispatchEvent(newFileNameSetEvent); 36 this.eventManager.dispatchEvent(newFileNameSetEvent);
36 } 37 }
37 if(evt.keyCode === 13){
38 var enterPressedEvent = document.createEvent("Events");
39 enterPressedEvent.initEvent("enterPressed", false, false);
40 enterPressedEvent.newFileName = this.newFileName.value;
41 this.eventManager.dispatchEvent(enterPressedEvent);
42 }
43 } 38 }
44 } 39 }
45 40
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
index f63067b1..d5b59ab8 100644
--- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
@@ -98,20 +98,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
98 98
99 this.addIdentifiers(); 99 this.addIdentifiers();
100 100
101 this.element.addEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false);
102 this.element.addEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only
103 this.eventManager.addEventListener("newFileDirectorySet", function(evt){that.handleNewFileDirectorySet(evt);}, false);
104 this.eventManager.addEventListener("newFileNameSet", function(evt){that.handleNewFileNameSet(evt);}, false);
105
106 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
107 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
108
109 this.element.addEventListener("enterPressed", function(evt){
110 if(!that.okButton.hasAttribute("disabled")){
111 that.handleOkButtonAction(evt);
112 }
113 }, false);
114
115 if(!!this.newFileModel.defaultProjectType){ 101 if(!!this.newFileModel.defaultProjectType){
116 var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType); 102 var templates = this.newFileModel.prepareContents(this.newFileModel.defaultProjectType);
117 this.templateList = iconsListModule.IconsList.create(); 103 this.templateList = iconsListModule.IconsList.create();
@@ -122,7 +108,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
122 this.templateList.element = this.templateIcons; 108 this.templateList.element = this.templateIcons;
123 this.templateList.needsDraw = true; 109 this.templateList.needsDraw = true;
124 110
125
126 this.selectedProjectType = {"uri":this.newFileModel.defaultProjectType, "element":null}; 111 this.selectedProjectType = {"uri":this.newFileModel.defaultProjectType, "element":null};
127 } 112 }
128 113
@@ -133,6 +118,18 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
133 fileExtensionEl.innerHTML = ""+this.newFileModel.projectTypeData[this.newFileModel.defaultProjectType].fileExtension; 118 fileExtensionEl.innerHTML = ""+this.newFileModel.projectTypeData[this.newFileModel.defaultProjectType].fileExtension;
134 } 119 }
135 } 120 }
121
122 this.element.addEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false);
123 this.element.addEventListener("selectedItem", function(evt){that.handleNewFileNavSelectedItem(evt);}, false);//for single selection only
124 this.eventManager.addEventListener("newFileDirectorySet", function(evt){
125 that.handleNewFileDirectorySet(evt);
126 }, false);
127 this.eventManager.addEventListener("newFileNameSet", function(evt){
128 that.handleNewFileNameSet(evt);
129 }, false);
130
131 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
132 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
136 } 133 }
137 134
138 }, 135 },
@@ -314,7 +311,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
314 311
315 handleNewFileDirectorySet:{ 312 handleNewFileDirectorySet:{
316 value:function(evt){ 313 value:function(evt){
317 if(!!evt._event.newFileDirectory){ 314 if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){
315 this.handleOkButtonAction(evt);
316 }
317 else if(!!evt._event.newFileDirectory){
318 this.newFileDirectory = evt._event.newFileDirectory; 318 this.newFileDirectory = evt._event.newFileDirectory;
319 if(this.isValidUri(this.newFileDirectory)){ 319 if(this.isValidUri(this.newFileDirectory)){
320 this.enableOk(); 320 this.enableOk();
@@ -325,7 +325,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
325 325
326 handleNewFileNameSet:{ 326 handleNewFileNameSet:{
327 value:function(evt){ 327 value:function(evt){
328 if(!!evt._event.newFileName){ 328 if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){
329 this.handleOkButtonAction(evt);
330 }
331 else if(!!evt._event.newFileName){
329 this.newFileName = evt._event.newFileName; 332 this.newFileName = evt._event.newFileName;
330 if(this.isValidFileName(this.newFileName)){ 333 if(this.isValidFileName(this.newFileName)){
331 this.enableOk(); 334 this.enableOk();
@@ -386,8 +389,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
386 389
387 this.newFileName = ""; 390 this.newFileName = "";
388 this.newFileDirectory = ""; 391 this.newFileDirectory = "";
389 this.selectedProjectType = null;
390 this.selectedTemplate = null;
391 392
392 //remove event listeners 393 //remove event listeners
393 this.element.removeEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false); 394 this.element.removeEventListener("drawTree", function(evt){that.handleNewFileNavDrawTree(evt);}, false);
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
index 98749106..4d07ca66 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js
@@ -66,7 +66,10 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, {
66 66
67 handleNewFileDirectorySet:{ 67 handleNewFileDirectorySet:{
68 value:function(evt){ 68 value:function(evt){
69 if(!!evt._event.newFileDirectory){ 69 if((evt.keyCode === 13) && !this.okButton.hasAttribute("disabled")){
70 this.handleOkButtonAction(evt);
71 }
72 else if(!!evt._event.newFileDirectory){
70 this.folderUri = evt._event.newFileDirectory; 73 this.folderUri = evt._event.newFileDirectory;
71 if(this.isValidUri(this.folderUri)){ 74 if(this.isValidUri(this.folderUri)){
72 this.enableOk(); 75 this.enableOk();