From c771d7c31a6a8817753079f0010b8e1cbda8c11a Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 5 Jan 2024 12:53:00 +0000 Subject: =?UTF-8?q?=C3=83display=20selected=20mid=20in=20an=20open=20state?= =?UTF-8?q?=20-=20issue=20#1425?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/js/main.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index d022ee4a9..5c5e030c6 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -847,9 +847,21 @@ function scrollToItem() { function collapseHeight() { $(".wall-item-content:not('.divmore_checked'), .directory-collapse:not('.divmore_checked')").each(function(i) { - var orgHeight = $(this).outerHeight(true); - var id = $(this).attr('id') - var open = ((expanded_items.indexOf($(this).attr('id')) === -1) ? false : true); + let orgHeight = $(this).outerHeight(true); + let id = $(this).attr('id'); + + if (bParam_mid) { + // Display the selected mid in an open state + let num_id = id.split('wall-item-content-').pop(); + let b64mids = $('#thread-wrapper-' + num_id).data('b64mids'); + + if (b64mids.indexOf(bParam_mid) !== -1) {; + expanded_items.push(id); + } + } + + let open = ((expanded_items.indexOf(id) === -1) ? false : true); + if(orgHeight > divmore_height) { if(! $(this).hasClass('divmore') && $(this).has('div.no-collapse').length == 0) { $(this).readmore({ -- cgit v1.2.3