check if shift key was preset when clicked in a folder/document row

This commit is contained in:
Uwe Steinmann 2021-05-14 19:05:02 +02:00
parent 639c280920
commit 1ac8f31105
3 changed files with 45 additions and 23 deletions

View File

@ -2751,8 +2751,12 @@ $(document).ready( function() {
?> ?>
/* catch click on a document row in the list folders and documents */ /* 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) { $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(ev) {
if(ev.shiftKey) {
$(ev.currentTarget).parent().toggleClass('selected');
} else {
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; window.location = '../out/out.ViewDocument.php?documentid=' + attr_id;
}
}); });
<?php <?php
} }
@ -2772,10 +2776,14 @@ $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(e
?> ?>
/* catch click on a document row in the list folders and documents */ /* 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) { $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) {
if(ev.shiftKey) {
$(ev.currentTarget).parent().toggleClass('selected');
} else {
attr_id = $(ev.currentTarget).parent().data('target-id'); attr_id = $(ev.currentTarget).parent().data('target-id');
if(typeof attr_id == 'undefined') if(typeof attr_id == 'undefined')
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; window.location = '../out/out.ViewFolder.php?folderid=' + attr_id;
}
}); });
<?php <?php
} }

View File

@ -194,6 +194,9 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* the table row when deleting the folder * the table row when deleting the folder
* This was added for the internal_link extensіon * This was added for the internal_link extensіon
*/ */
if(ev.shiftKey) {
$(ev.currentTarget).parent().toggleClass('selected');
} else {
attr_id = $(ev.currentTarget).parent().data('target-id'); attr_id = $(ev.currentTarget).parent().data('target-id');
if(typeof attr_id == 'undefined') if(typeof attr_id == 'undefined')
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
@ -201,6 +204,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
$([document.documentElement, document.body]).animate({ $([document.documentElement, document.body]).animate({
scrollTop: 200 scrollTop: 200
}, 200); }, 200);
}
}); });
<?php <?php
$this->printClickDocumentJs(); $this->printClickDocumentJs();

View File

@ -2798,8 +2798,12 @@ $(document).ready( function() {
?> ?>
/* catch click on a document row in the list folders and documents */ /* 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) { $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(ev) {
if(ev.shiftKey) {
$(ev.currentTarget).parent().toggleClass('selected');
} else {
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
window.location = '../out/out.ViewDocument.php?documentid=' + attr_id; window.location = '../out/out.ViewDocument.php?documentid=' + attr_id;
}
}); });
<?php <?php
} }
@ -2819,10 +2823,14 @@ $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(e
?> ?>
/* catch click on a document row in the list folders and documents */ /* 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) { $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) {
if(ev.shiftKey) {
$(ev.currentTarget).parent().toggleClass('selected');
} else {
attr_id = $(ev.currentTarget).parent().data('target-id'); attr_id = $(ev.currentTarget).parent().data('target-id');
if(typeof attr_id == 'undefined') if(typeof attr_id == 'undefined')
attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3];
window.location = '../out/out.ViewFolder.php?folderid=' + attr_id; window.location = '../out/out.ViewFolder.php?folderid=' + attr_id;
}
}); });
<?php <?php
} }
@ -2858,10 +2866,12 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
* {@link SeedDMS_Bootstrap_Style::folderListRowStart()} * {@link SeedDMS_Bootstrap_Style::folderListRowStart()}
*/ */
function documentListRowStart($document, $class='') { /* {{{ */ function documentListRowStart($document, $class='') { /* {{{ */
if($class) {
if($class == 'error') if($class == 'error')
$class = 'table-danger'; $class = 'table-danger';
else else
$class = 'table-'.$class; $class = 'table-'.$class;
}
$docID = $document->getID(); $docID = $document->getID();
return "<tr id=\"table-row-document-".$docID."\" data-target-id=\"".$docID."\" class=\"table-row-document droptarget ".($class ? ' '.$class : '')."\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('')."\" draggable=\"true\" data-name=\"".htmlspecialchars($document->getName(), ENT_QUOTES)."\">"; return "<tr id=\"table-row-document-".$docID."\" data-target-id=\"".$docID."\" class=\"table-row-document droptarget ".($class ? ' '.$class : '')."\" data-droptarget=\"document_".$docID."\" rel=\"document_".$docID."\" formtoken=\"".createFormKey('')."\" draggable=\"true\" data-name=\"".htmlspecialchars($document->getName(), ENT_QUOTES)."\">";
} /* }}} */ } /* }}} */