From a6948e635389768fc316f1fb86df2524b482b47c Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 13 Feb 2012 18:48:18 -0800 Subject: added logical drive selection to file picker Signed-off-by: Ananya Sen --- .../ui/FilePicker/pickerNavigator.reel/pickerNavigator.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/components/ui/FilePicker') diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js index ff9c7073..6b0d92f7 100644 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js @@ -149,6 +149,12 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { leftNav.appendChild(newDiv); if(dirObj.uri === this.pickerModel.currentRoot){ newDiv.classList.add("highlighted"); + //enable ok for logical drive selections, when in directory selection mode + if(this.pickerModel.inFileMode === false){ + this.okButton.removeAttribute("disabled"); + //put into selectedItems..currently single selection is supported + this.selectedItems = [dirObj.uri]; + } } newDiv.addEventListener("click", function(evt){that.handleTopLevelDirectoryClicks(evt, dirObj);}, false); @@ -571,6 +577,13 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { if(!evt.target.classList.contains("highlighted")){ evt.target.classList.add("highlighted"); } + + //enable ok for logical drive selections, when in directory selection mode + if(this.pickerModel.inFileMode === false){ + this.okButton.removeAttribute("disabled"); + //put into selectedItems..currently single selection is supported + this.selectedItems = [dirObj.uri]; + } } }, -- cgit v1.2.3