Bug 685868 - Don't update thumbnails if tablet mode hasn't changed. r=lucasr
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 09 Sep 2011 09:06:36 -0700
changeset 76839 984570d15e87a4f81a5c2c04af78bd4966582ca8
parent 76838 72bace03b6ce24ddf4d8ae9b3051cfa76a35cc46
child 76840 a739df5e7bc0b74880944fab3e2202fa11bce435
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerslucasr
bugs685868
milestone9.0a1
Bug 685868 - Don't update thumbnails if tablet mode hasn't changed. r=lucasr
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -544,17 +544,22 @@ var BrowserUI = {
   },
 
   observe: function observe(aSubject, aTopic, aData) {
     if (aTopic == "nsPref:changed" && aData == "browser.ui.layout.tablet")
       this.updateTabletLayout();
   },
 
   updateTabletLayout: function updateTabletLayout() {
-    if (Util.isTablet({ forceUpdate: true })) {
+    let wasTablet = Elements.urlbarState.hasAttribute("tablet");
+    let isTablet = Util.isTablet({ forceUpdate: true });
+    if (wasTablet == isTablet)
+      return;
+
+    if (isTablet) {
       this.unlockToolbar();
       Elements.urlbarState.setAttribute("tablet", "true");
     } else {
       Elements.urlbarState.removeAttribute("tablet");
     }
 
     // Tablet mode changes the size of the thumbnails
     // in the tabs container. Hence we have to force a