aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorHubzilla <hubzilla@hz.macgirvin.com>2017-01-20 12:03:46 -0800
committerHubzilla <hubzilla@hz.macgirvin.com>2017-01-20 12:03:46 -0800
commitece1dd1d7edc800085def93e50efc25a3dda55a7 (patch)
tree5fb0f7c315b2a001ecbb99117e22bbf4ff22faa4 /view/js/main.js
parentf57926d9ece52df0208695bdf48b918444448ed1 (diff)
downloadvolse-hubzilla-ece1dd1d7edc800085def93e50efc25a3dda55a7.tar.gz
volse-hubzilla-ece1dd1d7edc800085def93e50efc25a3dda55a7.tar.bz2
volse-hubzilla-ece1dd1d7edc800085def93e50efc25a3dda55a7.zip
js errors with raw message-id, string update
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/view/js/main.js b/view/js/main.js
index c67f1c167..2fc912093 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -662,7 +662,13 @@ function updateConvItems(mode,data) {
}
// auto-scroll to a particular comment in a thread (designated by mid) when in single-thread mode
- if($('.item_' + bParam_mid.substring(0,32)).length && !$('.item_' + bParam_mid.substring(0,32)).hasClass('toplevel_item') && mode == 'replace') {
+ // use the same method to generate the submid as we use in ThreadItem,
+ // substr(0,32) + base64_encode + replace(['+','='],['','']);
+ var submid = bParam_mid;
+ var submid_encoded = ((submid.length) ? submid.substring(0,32) : 'abcdefg');
+ submid_encoded = window.btoa(submid_encoded);
+ submid_encoded = submid_encoded.replace(/[\+\=]/g,'');
+ if($('.item_' + submid_encoded).length && !$('.item_' + submid_encoded).hasClass('toplevel_item') && mode == 'replace') {
if($('.collapsed-comments').length) {
var scrolltoid = $('.collapsed-comments').attr('id').substring(19);
$('#collapsed-comments-' + scrolltoid + ' .autotime').timeago();
@@ -670,8 +676,8 @@ function updateConvItems(mode,data) {
$('#hide-comments-' + scrolltoid).html(aStr.showfewer);
$('#hide-comments-total-' + scrolltoid).hide();
}
- $('html, body').animate({ scrollTop: $('.item_' + bParam_mid.substring(0,32)).offset().top - $('nav').outerHeight() }, 'slow');
- $('.item_' + bParam_mid.substring(0,32)).addClass('item-highlight');
+ $('html, body').animate({ scrollTop: $('.item_' + submid_encoded).offset().top - $('nav').outerHeight() }, 'slow');
+ $('.item_' + submid_encoded).addClass('item-highlight');
}
$(document.body).trigger("sticky_kit:recalc");