more infrastructure for notification auto-scroll to comment

This commit is contained in:
redmatrix 2016-09-24 20:10:20 -07:00
parent 39dc4fc992
commit bfc2552841
2 changed files with 11 additions and 2 deletions

View File

@ -412,8 +412,11 @@ class ThreadItem {
if($visible_comments === false)
$visible_comments = 3;
if(in_array(\App::$module,['display','update_display']))
$visible_comments = 99999;
// needed for scroll to comment from notification but needs more work
// as we do not want to open all comments unless there is actually an #item_xx anchor
// and the url fragment is not sent to the server.
// if(in_array(\App::$module,['display','update_display']))
// $visible_comments = 99999;
if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
foreach($children as $child) {

View File

@ -249,6 +249,7 @@ var divmore_height = 400;
var last_filestorage_id = null;
var mediaPlaying = false;
var contentHeightDiff = 0;
var gotoAnchor = ((document.location.hash.includes('item_')) ? document.location.hash : '');
$(function() {
$.ajaxSetup({cache: false});
@ -650,6 +651,11 @@ function updateConvItems(mode,data) {
collapseHeight();
}
if(gotoAnchor != '') {
document.location.hash = gotoAnchor;
gotoAnchor = '';
}
}
function collapseHeight() {