Bug 967286 - Default to Layout.FRAME if layout type isn't specified (r=margaret)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 25 Feb 2014 17:40:50 +0000
changeset 170479 95ff5102419c0e9f741a0792c9b0d0205e93b8f8
parent 170478 6fa0c7a9f778bacc2bfd722b7b5f86381e1d1ce5
child 170480 7ab155a7aa6767b9a0e047d0b08e27ed946ddebe
push id26288
push userryanvm@gmail.com
push dateTue, 25 Feb 2014 20:20:43 +0000
treeherdermozilla-central@22650589a724 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs967286
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 967286 - Default to Layout.FRAME if layout type isn't specified (r=margaret)
mobile/android/modules/Home.jsm
--- a/mobile/android/modules/Home.jsm
+++ b/mobile/android/modules/Home.jsm
@@ -205,17 +205,20 @@ let HomePanels = (function () {
 
   let _generatePanel = function(id) {
     let panel = new Panel(id, _registeredPanels[id]());
 
     if (!panel.id || !panel.title) {
       throw "Home.panels: Can't create a home panel without an id and title!";
     }
 
-    if (!_valueExists(Layout, panel.layout)) {
+    if (!panel.layout) {
+      // Use FRAME layout by default
+      panel.layout = Layout.FRAME;
+    } else if (!_valueExists(Layout, panel.layout)) {
       throw "Home.panels: Invalid layout for panel: panel.id = " + panel.id + ", panel.layout =" + panel.layout;
     }
 
     for (let view of panel.views) {
       if (!_valueExists(View, view.type)) {
         throw "Home.panels: Invalid view type: panel.id = " + panel.id + ", view.type = " + view.type;
       }