Difference between revisions of "MediaWiki:Common.js"

From Utpalasia Wiki
Jump to navigation Jump to search
(change to prevent infinite redirects in Chrome on Android)
(width variable changed for compatibility)
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
  
if(window.outerWidth <= 800 && document.URL.search("mobile") != -1)
+
if(documentElement.clientWidth <= 787 && document.URL.search("mobile") != -1)
 
{
 
{
 
   window.location.replace(document.URL + "&mobileaction=toggle_view_mobile");
 
   window.location.replace(document.URL + "&mobileaction=toggle_view_mobile");
 
}
 
}

Revision as of 20:50, 29 March 2013

/* Any JavaScript here will be loaded for all users on every page load. */

if(documentElement.clientWidth <= 787 && document.URL.search("mobile") != -1)
{
  window.location.replace(document.URL + "&mobileaction=toggle_view_mobile");
}