aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
diff options
context:
space:
mode:
authorEric Guzman2012-04-02 15:36:08 -0700
committerEric Guzman2012-04-02 15:36:08 -0700
commit0241bf331b7e06e206a54be441edf2f4c7261f63 (patch)
treeb7e2f9cad73eed4fc616cf1841cd0be02bd955d4 /js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
parentdde5b5054f93db493e5d4d502e677f5781334b08 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-0241bf331b7e06e206a54be441edf2f4c7261f63.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js')
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
index 7a9d90b4..945b0301 100644
--- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
+++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
@@ -258,12 +258,20 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
258 this.element.addEventListener("refreshTreeSegment", function(evt){that.handlePickerNavRefreshTreeSegment(evt);}, false); 258 this.element.addEventListener("refreshTreeSegment", function(evt){that.handlePickerNavRefreshTreeSegment(evt);}, false);
259 this.resultsArea.addEventListener("click", function(evt){that.handleResultsAreaClick(evt);}, false); 259 this.resultsArea.addEventListener("click", function(evt){that.handleResultsAreaClick(evt);}, false);
260 this.element.addEventListener("click", function(evt){that.handlePickerNavClick(evt);}, false); 260 this.element.addEventListener("click", function(evt){that.handlePickerNavClick(evt);}, false);
261
262 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false); 261 this.okButton.addEventListener("click", function(evt){that.handleOkButtonAction(evt);}, false);
263 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false); 262 this.cancelButton.addEventListener("click", function(evt){that.handleCancelButtonAction(evt);}, false);
264 263
264 this.element.addEventListener("keyup", function(evt){
265 if(evt.keyCode == 27) {
266 if(that.application.ninja.filePickerController.pickerNavChoices !== null){
267 that.handleCancelButtonAction();
268 }
269 }
270 }, true);
271
265 //ready to show picker now 272 //ready to show picker now
266 this.element.style.visibility = "visible"; 273 this.element.style.visibility = "visible";
274 this.element.focus();
267 } 275 }
268 }, 276 },
269 277
@@ -501,7 +509,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
501 metadata = "Name: "+data.name; 509 metadata = "Name: "+data.name;
502 } 510 }
503 metadata = metadata + "<br />" + "Type: "+data.type; 511 metadata = metadata + "<br />" + "Type: "+data.type;
504 if(data.size){metadata = metadata + "<br />" + "Size: "+data.size;} 512 if(data.size){metadata = metadata + "<br />" + "Size: "+data.size+" bytes";}
505 if(data.creationDate){metadata = metadata + "<br />" + "Creation date: "+ this.formatTimestamp(data.creationDate);} 513 if(data.creationDate){metadata = metadata + "<br />" + "Creation date: "+ this.formatTimestamp(data.creationDate);}
506 if(data.modifiedDate){metadata = metadata + "<br />" + "Modified date: "+ this.formatTimestamp(data.modifiedDate);} 514 if(data.modifiedDate){metadata = metadata + "<br />" + "Modified date: "+ this.formatTimestamp(data.modifiedDate);}
507 } 515 }
@@ -1071,6 +1079,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
1071 //clear memory - TODO:check for more memory leaks 1079 //clear memory - TODO:check for more memory leaks
1072 this.pickerModel = null; 1080 this.pickerModel = null;
1073 this.application.ninja.filePickerController._directoryContentCache = {}; 1081 this.application.ninja.filePickerController._directoryContentCache = {};
1082 this.application.ninja.filePickerController.pickerNavChoices = null;
1074 //remove listeners 1083 //remove listeners
1075 this.element.removeEventListener("openFolder", this, false);//add icon double click event listener to reload iconList with new set of data 1084 this.element.removeEventListener("openFolder", this, false);//add icon double click event listener to reload iconList with new set of data
1076 this.element.removeEventListener("selectedItem", this, false);//for single selection only 1085 this.element.removeEventListener("selectedItem", this, false);//for single selection only