diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 6f58067dd..b5e0e7e7b 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2281,7 +2281,9 @@ $('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 */ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) { - attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; + 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)."\">"; + return "getName(), ENT_QUOTES)."\">"; } /* }}} */ function documentListRowEnd($document) { /* {{{ */ diff --git a/views/bootstrap/class.ViewFolder.php b/views/bootstrap/class.ViewFolder.php index 61492e27c..2585bd4cf 100644 --- a/views/bootstrap/class.ViewFolder.php +++ b/views/bootstrap/class.ViewFolder.php @@ -183,7 +183,14 @@ $('body').on('click', '#goto-parent', function(ev) { }); /* catch click on a folder 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]; + /* retrieve the id of the target folder either from data-target-id or + * from the id. Prefer data-target-id because the id is also used for identifying + * the table row when deleting the folder + * This was added for the internal_link extensŃ–on + */ + attr_id = $(ev.currentTarget).parent().data('target-id'); + if(typeof attr_id == 'undefined') + attr_id = $(ev.currentTarget).parent().attr('id').split('-')[3]; folderSelected(attr_id, ''); $([document.documentElement, document.body]).animate({ scrollTop: 200