diff options
author | Valerio Virgillito | 2012-02-23 01:55:14 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-23 01:55:14 -0800 |
commit | 64a971f63333d74ca89690892a52948b3bd4283a (patch) | |
tree | 61bac34de22852efd2b9b8880f62210685b16297 /js/io/ui/file-picker/picker-navigator.reel | |
parent | aaa8d05cc3cfd94322d356e265b94b0abb9f6305 (diff) | |
parent | d264092596ba697cd04738566184270dc608be63 (diff) | |
download | ninja-64a971f63333d74ca89690892a52948b3bd4283a.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into file-io
Diffstat (limited to 'js/io/ui/file-picker/picker-navigator.reel')
-rw-r--r-- | js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | 26 |
1 files changed, 21 insertions, 5 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 411386f9..428e7bab 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 | |||
@@ -214,6 +214,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
214 | 214 | ||
215 | this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data | 215 | this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data |
216 | this.element.addEventListener("selectedItem", function(evt){that.handlePickerNavSelectedItem(evt);}, false);//for single selection only | 216 | this.element.addEventListener("selectedItem", function(evt){that.handlePickerNavSelectedItem(evt);}, false);//for single selection only |
217 | this.element.addEventListener("selectFile", function(evt){that.handlePickerNavSelectedFile(evt);}, false);//for file selection | ||
217 | this.element.addEventListener("showMetadata", function(evt){that.handlePickerNavShowMetadata(evt);}, false);//show metadata on hover of icon | 218 | this.element.addEventListener("showMetadata", function(evt){that.handlePickerNavShowMetadata(evt);}, false);//show metadata on hover of icon |
218 | this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon | 219 | this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon |
219 | //this.addressGo.addEventListener("click", this, false); | 220 | //this.addressGo.addEventListener("click", this, false); |
@@ -669,14 +670,29 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { | |||
669 | } | 670 | } |
670 | }, | 671 | }, |
671 | 672 | ||
673 | handlePickerNavSelectedFile:{ | ||
674 | value: function(evt){ | ||
675 | var uri = evt.fileUri; | ||
676 | |||
677 | //do selection if in file selection mode | ||
678 | if(this.pickerModel.inFileMode && (this.application.ninja.filePickerController._directoryContentCache[uri].type === "file")){ | ||
679 | this.okButton.removeAttribute("disabled"); | ||
680 | //put into selectedItems..currently single selection is supported | ||
681 | this.selectedItems = [uri]; | ||
682 | this.currentURI = uri.substring(0, uri.lastIndexOf("/")); | ||
683 | this.handleOkButtonAction(); | ||
684 | } | ||
685 | } | ||
686 | }, | ||
687 | |||
672 | handlePickerNavShowMetadata: { | 688 | handlePickerNavShowMetadata: { |
673 | value: function(evt){ | 689 | value: function(evt){ |
674 | //update matadata only if nothing is already selected | 690 | //update matadata only if nothing is already selected |
675 | if(this.currentSelectedNode == null){ | 691 | if(this.currentSelectedNode == null){ |
676 | //console.log("handle showmetadata - true"); | 692 | //console.log("handle showmetadata - true"); |
677 | this.metadataSection.innerHTML = evt.metadata; | 693 | this.metadataSection.innerHTML = evt.metadata; |
678 | } | ||
679 | } | 694 | } |
695 | } | ||
680 | }, | 696 | }, |
681 | 697 | ||
682 | handlePickerNavUpdateMetadata:{ | 698 | handlePickerNavUpdateMetadata:{ |