Index: openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js,v
diff -u -N -r1.10 -r1.11
--- openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 2 Jan 2008 07:12:12 -0000 1.10
+++ openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 14 Jan 2008 02:53:06 -0000 1.11
@@ -1626,11 +1626,32 @@
if(shareWindow == null) {
- var shareFormBody = new Ext.Panel({
- id:'form_addtag',
- autoScroll:true,
+ var communities = new Ext.data.JsonStore({
+ url: xmlhttpurl+'list-communities',
+ root: 'communities',
+ fields: ['target_folder_id', 'instance_name']
+ });
+
+ this.communityCombo = new Ext.form.ComboBox({
+ id:'communities_list',
+ store: communities,
+ displayField:'instance_name',
+ typeAhead: true,
+ fieldLabel:'Community',
+ triggerAction: 'all',
+ emptyText:'Select a community',
+ hiddenName:'target_folder_id',
+ valueField:'target_folder_id',
+ forceSelection:true,
+ handleHeight: 80,
+ selectOnFocus:true
+ });
+
+ var shareFormBody = new Ext.form.FormPanel({
+ id:'sharefolderform',
+ title:'Select the community where you wish to share the '+foldertitle+' folder with.',
frame:true,
- html: "
Select the community where you wish to share the "+foldertitle+" folder with.
"
+ items : this.communityCombo
});
var shareBtns = [{
@@ -1662,44 +1683,18 @@
buttons: shareBtns
});
- shareWindow.on("show",function() {
+ this.sharefolderWindow = shareWindow;
- if(this.communityCombo == null) {
-
- var communities = new Ext.data.JsonStore({
- url: xmlhttpurl+'list-communities',
- root: 'communities',
- fields: ['target_folder_id', 'instance_name']
- });
-
- this.communityCombo = new Ext.form.ComboBox({
- store: communities,
- displayField:'instance_name',
- typeAhead: true,
- triggerAction: 'all',
- emptyText:'Select a community',
- hiddenName:'target_folder_id',
- valueField:'target_folder_id',
- forceSelection:true,
- handleHeight: 80,
- selectOnFocus:true,
- applyTo:'communities_list'
- });
-
- }
-
- },this);
-
} else {
+ this.sharefolderWindow.findById('sharefolderform').setTitle('Select the community where you wish to share the '+foldertitle+' folder with.');
this.communityCombo.reset();
}
shareWindow.show();
},
-
// redirect to object views for a file
redirectViews : function(grid,i,e) {
var filepanel = grid;
@@ -1734,6 +1729,7 @@
var filepanel = grid;
var node = filepanel.store.getAt(i);
+ filepanel.getSelectionModel().selectRow(i);
var object_id = node.get("id");
var fstitle = node.get("filename");
var revWindow = this.revisionsWindow;