Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-28 22:14:50 +0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-28 22:15:07 +0400
commit5f0ab971f1b1e9ffcd35d8fb7489fae8106dcef5 (patch)
treed9df3eddcc8ee3e2ca62e40cbfd3424938341679 /files
parent5c9178f85161c90c4c58c6ab68b2828938908845 (diff)
Ctrl+Click on td.filename a selects file instead of default file action
Diffstat (limited to 'files')
-rw-r--r--files/js/files.js35
1 files changed, 27 insertions, 8 deletions
diff --git a/files/js/files.js b/files/js/files.js
index 5770285cfbd..e3b181262f9 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -28,16 +28,35 @@ $(document).ready(function() {
// Sets the file link behaviour :
$('td.filename a').live('click',function(event) {
- event.preventDefault();
- var filename=$(this).parent().parent().data('file');
- if(!FileList.isLoading(filename)){
- var mime=$(this).parent().parent().data('mime');
- var type=$(this).parent().parent().data('type');
- var action=FileActions.getDefault(mime,type);
- if(action){
- action(filename);
+ if (event.ctrlKey) {
+ event.preventDefault();
+ var checkbox = $(this).parent().children('input:checkbox');
+ if ($(checkbox).attr('checked')) {
+ $(checkbox).removeAttr('checked');
+ $(checkbox).parent().parent().removeClass('selected');
+ $('#select_all').removeAttr('checked');
+ } else {
+ $(checkbox).attr('checked', 'checked');
+ $(checkbox).parent().parent().toggleClass('selected');
+ var selectedCount=$('td.filename input:checkbox:checked').length;
+ if (selectedCount == $('td.filename input:checkbox').length) {
+ $('#select_all').attr('checked', 'checked');
+ }
+ }
+ procesSelection();
+ } else {
+ event.preventDefault();
+ var filename=$(this).parent().parent().data('file');
+ if(!FileList.isLoading(filename)){
+ var mime=$(this).parent().parent().data('mime');
+ var type=$(this).parent().parent().data('type');
+ var action=FileActions.getDefault(mime,type);
+ if(action){
+ action(filename);
+ }
}
}
+
});
// Sets the select_all checkbox behaviour :