Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1561 closed Bug (fixed)

Google Chrome reloads dashboard twice

Reported by: matt Owned by:
Priority: major Milestone: Piwik 0.9.9 - Stable release
Component: UI - UX (AngularJS, twig, less) Keywords:
Cc: Sensitive: no

Description

When I go to http://demo.piwik.org using Google Chrome on windows XP, the dashboard first partly loads, then the dashboard visibly reloads itself. This is def not expected.

Attachments (1)

#1561-20100816-v1.diff (1.7 KB) - added by peterb 4 years ago.
Replaces the $.browser.chrome browser-detection hack with a short workaround. Please check, because I'm no JS hero! I tested in Chrome / IE8 / FF3 / Safari and the x-offset of the control-icons seemed ok.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 4 years ago by vipsoft (robocoder)

In IE8 on Vista, I was getting a lot of console errors, "Object doesn't support this property or method". Disabling the PDFReports plugin seemed to fix this.

comment:2 Changed 4 years ago by peterb (peterbo)

This behaviour is somehow caused by the visitor country map plugin. Disabling it, fixes the problem.

comment:3 Changed 4 years ago by matt (mattab)

I can confirm that issue is caused with the Maps widget.

Peter, good stuff. I'm curious, how did you find out the cause?

comment:4 Changed 4 years ago by peterb (peterbo)

This was not a big deal. I was able to reproduce the bug with the current trunk but not with the current install on a webserver. The only difference between these two installs was the World-Map plugin.

The problem could be further tracked down to line 21 in worldmap.tpl
Since it is a chrome-specific issue it could either be a bug in chrome js engine or an error with a conditional comment for chrome

$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());

deleting it seems to fix the issue (please confirm).

Further info to the browser detection of jquery: http://api.jquery.com/jQuery.browser/

Update:
JQuery.browser - object seems to be deprecated as of version 1.3.
http://xhtml.co.il/en/page-1013/jQuery.browser

Now the JQuery.support-object should be used instead to determine if the browser supports w3c boxModel etc.:
http://xhtml.co.il/en/page-1012/jQuery.support

Changed 4 years ago by peterb (peterbo)

Replaces the $.browser.chrome browser-detection hack with a short workaround. Please check, because I'm no JS hero! I tested in Chrome / IE8 / FF3 / Safari and the x-offset of the control-icons seemed ok.

comment:5 Changed 4 years ago by greg (gka)

I had to introduce this line because the default jQuery browser detection makes no difference between Safari and Chrome but both browsers have different ways of calculating the width of a html select element. I don't think that this issue is connected to the box-model bug.

There are serveral work-arounds for this:

  • we find a way to detect Safari that doesn't force Chrome to reload the page
  • we define a fixed width for the html select
  • we hard-code the select widths for every translated language
  • we just don't care about the users of buggy Safari
  • we throw away the fullscreen feature from the icon bar (it would only be accessible via context menu)
  • we break the UI consistency by aligning the icons to the right

comment:6 Changed 4 years ago by greg (gka)

The fix looks good, I'll commit this. Thanks a lot :)

comment:7 Changed 4 years ago by greg (gka)

  • Resolution set to fixed
  • Status changed from new to closed

(In [2950]) added bug-fix from peterB (fixes #1561)

comment:8 Changed 4 years ago by peterb (peterbo)

Greg, I think there is also a Variable to be changed on line 71.

comment:9 Changed 4 years ago by greg (gka)

Oh yes, I forgot to fix this because this is a very unnecessary line. The select elements width doesn't change as the browser window width changes. I'll remove it..

comment:10 Changed 4 years ago by peterb (peterbo)

"{*" and "*}" are no valid strings to capsule js comments, please fix as it is in .diff file.

Can be checked here:
http://www.w3schools.com/JS/tryit.asp?filename=tryjs_comments2

Update:
Sorry, my fault - it's a Smarty Comment and therefore it's ok!

comment:11 Changed 4 years ago by greg (gka)

I think these are Smarty comments which doesn't appear in the html output.

Note: See TracTickets for help on using tickets.