add js code for catching clicks on folder rows in one page mode

This commit is contained in:
Uwe Steinmann 2020-02-28 09:47:58 +01:00
parent b11aed0d18
commit 975c6cb147

View File

@ -2262,6 +2262,27 @@ $('body').on('click', '[id^=\"table-row-document\"] td:nth-child(2)', function(e
}
} /* }}} */
/**
* Print js code which catches clicks on folder rows
*
* This method will catch a click on a folder row and changes the
* window.location to the out.ViewFolder.php page
* This code is not needed on the out.ViewFolder.php page itself, because
* a click will just reload the list of folders and documents.
*/
function printClickFolderJs() { /* {{{ */
$onepage = $this->params['onepage'];
if($onepage) {
?>
/* 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().attr('id').split('-')[3];
window.location = '../out/out.ViewFolder.php?folderid=' + attr_id;
});
<?php
}
} /* }}} */
/**
* Start the row for a folder in list of documents and folders
*