aboutsummaryrefslogtreecommitdiff
path: root/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
diff options
context:
space:
mode:
authorJonathan Duran2012-03-29 07:27:27 -0700
committerJonathan Duran2012-03-29 07:27:27 -0700
commitab730848419a0b72c4c2747a3c928f2c8cc763e7 (patch)
tree6b48b82604e194016ca048ad912f8015de719999 /js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js
parent06f247d881f4cfd790d635c6e310ae7f97724339 (diff)
parent3fd2cdb59027b3f973b9165db9db4fdd22026941 (diff)
downloadninja-ab730848419a0b72c4c2747a3c928f2c8cc763e7.tar.gz
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
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