aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.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/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
parent85bf9f937fa2ec46e42f791fc6815f7c2f5446ea (diff)
downloadninja-5b0ff2b7347d158876c366c51988a94570dda18b.tar.gz
IKNINJA-1302 : more fix
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js')
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js39
1 files changed, 20 insertions, 19 deletions
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);