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') 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 From 50a40c4e21b9a4d53d6d1fb739d838c0319ab09b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 13 Feb 2012 19:55:46 -0800 Subject: new file dialog - preselect default template Signed-off-by: Ananya Sen --- js/components/ui/icon-list-basic/icon.reel/icon.js | 14 ++++++++++++++ .../ui/icon-list-basic/iconsList.reel/iconsList.html | 5 +++++ .../ui/icon-list-basic/iconsList.reel/iconsList.js | 8 +++++++- 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'js/components/ui') diff --git a/js/components/ui/icon-list-basic/icon.reel/icon.js b/js/components/ui/icon-list-basic/icon.reel/icon.js index d934e7f1..b0279207 100755 --- a/js/components/ui/icon-list-basic/icon.reel/icon.js +++ b/js/components/ui/icon-list-basic/icon.reel/icon.js @@ -22,6 +22,13 @@ var Icon = exports.Icon = Montage.create(Component, { this.needsDraw = true; } }, + + selectedUri:{ + writable:true, + enumerable:true, + value:null + }, + metadata:{ enumerable:true, writable:true, @@ -83,6 +90,13 @@ var Icon = exports.Icon = Montage.create(Component, { if(this.icondata.creationDate){this.metadata = this.metadata + "
" + "Creation date: "+ this.formatTimestamp(this.icondata.creationDate);} if(this.icondata.modifiedDate){this.metadata = this.metadata + "
" + "Modified date: "+ this.formatTimestamp(this.icondata.modifiedDate);} + //show default selection + if(this.icondata.uri === this.selectedUri){ + var selectedItemEvent = document.createEvent("Events"); + selectedItemEvent.initEvent("selectedItem", false, false); + selectedItemEvent.uri = this.icondata.uri; + this.element.dispatchEvent(selectedItemEvent); + } } }, diff --git a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html index 50a1d61d..0bb79873 100755 --- a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html +++ b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.html @@ -21,6 +21,11 @@ "boundObject": {"@": "repetition1"}, "boundObjectPropertyPath": "objectAtCurrentIteration", "oneway": true + }, + "selectedUri": { + "boundObject": {"@": "owner"}, + "boundObjectPropertyPath": "selected", + "oneway": true } } }, diff --git a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js index 56eb57c3..d36aa40f 100755 --- a/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js +++ b/js/components/ui/icon-list-basic/iconsList.reel/iconsList.js @@ -15,11 +15,17 @@ var IconsList = exports.IconsList = Montage.create(Component, { }, iconsViewDataObject:{ - writable:true, + writable:true, enumerable:true, value:[] }, + selected:{ + writable:true, + enumerable:true, + value:null + }, + willDraw: { enumerable: false, value: function() { -- cgit v1.2.3