From 1ac8f31105fd787e8c64768fbb6b1e4f2df46709 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 14 May 2021 19:05:02 +0200 Subject: [PATCH] check if shift key was preset when clicked in a folder/document row --- views/bootstrap/class.Bootstrap.php | 20 ++++++++++++------ views/bootstrap/class.ViewFolder.php | 18 +++++++++------- views/bootstrap4/class.Bootstrap4.php | 30 ++++++++++++++++++--------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 79f27fac7..b93a16179 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2751,8 +2751,12 @@ $(document).ready( function() { ?> /* catch click on a document row in the list folders and documents */ $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(ev) { - attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; - window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; + if(ev.shiftKey) { + $(ev.currentTarget).parent().toggleClass('selected'); + } else { + attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; + window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; + } }); /* catch click on a document row in the list folders and documents */ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) { - attr_id = $(ev.currentTarget).parent().data('target-id'); - if(typeof attr_id == 'undefined') - attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; - window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; + if(ev.shiftKey) { + $(ev.currentTarget).parent().toggleClass('selected'); + } else { + attr_id = $(ev.currentTarget).parent().data('target-id'); + if(typeof attr_id == 'undefined') + attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; + window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; + } }); printClickDocumentJs(); diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index ed720ed63..497b11c0d 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -2798,8 +2798,12 @@ $(document).ready( function() { ?> /* catch click on a document row in the list folders and documents */ $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(ev) { - attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; - window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; + if(ev.shiftKey) { + $(ev.currentTarget).parent().toggleClass('selected'); + } else { + attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; + window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; + } }); /* catch click on a document row in the list folders and documents */ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) { - attr_id = $(ev.currentTarget).parent().data('target-id'); - if(typeof attr_id == 'undefined') - attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; - window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; + if(ev.shiftKey) { + $(ev.currentTarget).parent().toggleClass('selected'); + } else { + attr_id = $(ev.currentTarget).parent().data('target-id'); + if(typeof attr_id == 'undefined') + attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; + window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; + } }); getID(); return "getName(), ENT_QUOTES)."\">"; } /* }}} */