From 8dc6b8cce118d3b54af78afcf68d52c7a1773280 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sun, 24 Jul 2022 03:31:38 -0700 Subject: [PATCH] make "scrollto" work again on mod_display after mid changes --- Code/Lib/ThreadItem.php | 2 +- view/js/main.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Code/Lib/ThreadItem.php b/Code/Lib/ThreadItem.php index a8362c363..93cf02110 100644 --- a/Code/Lib/ThreadItem.php +++ b/Code/Lib/ThreadItem.php @@ -508,7 +508,7 @@ class ThreadItem 'previewing' => ($conv->is_preview() ? true : false ), 'preview_lbl' => t('This is an unsaved preview'), 'wait' => t('Please wait'), - 'submid' => str_replace(['+','='], ['',''], base64_encode($item['mid'])), + 'submid' => str_replace(['+','='], ['',''], base64_encode(urlencode($item['mid']))), 'thread_level' => $thread_level, 'indentpx' => intval(get_pconfig(local_channel(), 'system', 'thread_indent_px', get_config('system', 'thread_indent_px', 0))), 'thread_max' => intval(get_config('system', 'thread_maxlevel', 20)) + 1 diff --git a/view/js/main.js b/view/js/main.js index a24c63e1a..cada11aeb 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -791,9 +791,6 @@ function updateConvItems(mode,data) { if($('#collapsed-comments-'+itmId).is(':visible')) isVisible = true; - - - // insert the content according to the mode and first_page // and whether or not the content exists already (overwrite it) @@ -914,7 +911,7 @@ function updateConvItems(mode,data) { let encoded = ((submid.substr(0,4) == 'b64.') ? true : false); let submid_encoded = ((encoded) ? submid.substr(4) : window.btoa(submid)); - submid_encoded = submid_encoded.replace(/[\+\=]/g,''); + submid_encoded = submid_encoded.replace(/[\+\=]/g,''); if($('.item_' + submid_encoded).length && !$('.item_' + submid_encoded).hasClass('toplevel_item') && mode == 'replace') { if($('.collapsed-comments').length) { let scrolltoid = $('.collapsed-comments').attr('id').substring(19);