[ZBX-6403] Remember position on refresh Created: 2013 Mar 17  Updated: 2017 Dec 15  Resolved: 2017 Dec 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.5
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Marc Assignee: Unassigned
Resolution: Duplicate Votes: 3
Labels: latestdata, patch, refresh, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux, CentOS-6.3, PostgreSQL 9.1.8, Apache HTTPD-2.2.15, PHP-5.3.3


Attachments: File main.js.patch    
Issue Links:
Duplicate
duplicates ZBX-12663 "Latest data" web page fresh causes g... Closed
is duplicated by ZBX-6546 Periodic page refresh by browser does... Closed

 Description   

Just noticed a small flaw.
For instance, have more information on 'Latest data' than fit on screen and scroll down to reach the lower ones. Unlike a manual refresh the automatic refresh lost the position and one has to scroll down again.

It would be nice if it's possible to remember the position on automatic refresh like it is already done (probably by the browser) on manual refreshes.



 Comments   
Comment by Andrei Gushchin (Inactive) [ 2013 Mar 17 ]

I confirm this. also in trunk has the same problem.

Comment by richlv [ 2013 Mar 17 ]

hmm. trunk r34416 - automatic refresh stays where i was scrolled (using opera 12.14).
neogan, is it the latest trunk revision you tried ? which browser ?

Comment by Andrei Gushchin (Inactive) [ 2013 Mar 17 ]

Yes correct trunk is r34416. I check in firefox 19.0.2 and chrome 25.0.1364.172 m. Both have this problem.

Comment by richlv [ 2013 Mar 17 ]

ah, interesting - it's browser specific.
works ok in opera 12.14, does not work in firefox 19.0.2

Comment by richlv [ 2013 Apr 30 ]

probably regressed from ZBX-869
edit : ignore that, can't be if it's in 2.0, too

Comment by Adam Sajner [ 2015 Mar 10 ]

Hi,

I just revert code from older rev, where was code working. Attached patch is for file /trunk/frontends/php/js/main.js.

Comment by Marc [ 2015 Mar 10 ]

puresoul, can you add a real patch instead of a regular diff?
E.g. something like:

diff -u ./js/main.js.orig ./js/main.js

The only relevant difference i see is the replacement of location.replace() by location.reload().

Anyhow, I've probably overseen something since replacing the mentioned function didn't changed anything to me.

Comment by Adam Sajner [ 2015 Mar 10 ]

ver. for patch replaced, thanks for suggestion

Comment by Marc [ 2015 Mar 11 ]

It seams that location.reload() indeed does the trick:

--- ./js/main.js.orig   2015-03-10 16:07:46.000000000 +0100
+++ ./js/main.js        2015-03-11 17:47:31.000000000 +0100
@@ -74,7 +74,7 @@

                this.delayLeft -= 1000;
                if (this.delayLeft < 0) {
-                       location.replace(location.href);
+                       location.reload();
                }
                else {
                        this.timeout = setTimeout('PageRefresh.check()', 1000);

Edit:
Btw, it fixes this issue for all affected monitoring site (Overview, IT-Services, Triggers, ...)

Edit:
This issue is likely caused by ZBX-4951

Comment by Adam Sajner [ 2015 Mar 11 ]

I'm pretty happy that it may fix this old "regression".

EDIT:

as you suggest ZBX-4951, maybe this patch would trade-of performance for usability.
But for me, this is working great. Scroll down on every automatic refresh drives me crazy.

Comment by Marc [ 2015 Mar 11 ]

i'm not sure whether location.reload() will cause a performance impact in the context of ZBX-4951.
According to W3SCHOOLS - Location reload() Method the browser cache is considered by default.

Comment by Adam Sajner [ 2015 Mar 11 ]

I'm not web developer or web expert, but as this frontend issue arise some time ago, I only want to share my knowledge.

Comment by richlv [ 2016 Feb 22 ]

ZBXNEXT-3159 is related, although maybe the linked subissue in ZBX-10007 solves it ?

Comment by Valdis Murzins [ 2017 Dec 15 ]

Closing as duplicate of ZBX-12663.

Generated at Sat Apr 27 08:11:34 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.