Merge pull request #1430 from lynnaloo/23299
authorTravis Webb <travis@traviswebb.com>
Wed, 30 Apr 2014 06:28:42 +0000 (02:28 -0400)
committerTravis Webb <travis@traviswebb.com>
Wed, 30 Apr 2014 06:28:42 +0000 (02:28 -0400)
Issue #23299 - Make navigator panels work like workspace panels

lib/enyo-x/source/layout/panels.js
lib/enyo-x/source/less/list.less
lib/enyo-x/source/stylesheets/screen.css
lib/enyo-x/source/views/navigator.js
lib/enyo-x/source/views/search.js
lib/enyo-x/source/views/transaction_list_container.js
lib/enyo-x/source/views/workspace.js

index dcee3d3..a7c87ad 100644 (file)
@@ -136,7 +136,7 @@ trailing:true*/
     @extends Panels
   */
   enyo.kind({
-    name: "XV.WorkspaceContainerPanels",
+    name: "XV.ContainerPanels",
     kind: "Panels",
     arrangerKind: "CollapsingArranger",
     draggable: true,
@@ -155,7 +155,7 @@ trailing:true*/
   });
 
   enyo.kind({
-    name: 'XV.AppPanels',
+    name: 'XV.SearchPanels',
     kind: 'XV.GridPanels',
     classes: 'xv-app-panel-container',
     controlClasses: 'xv-app-panel'
index 861b183..e5bb712 100644 (file)
   &.third {
     width: 100px;
   }
-  &.money {
-    width: 75px;
-    text-align: right;
-  }
-  &.quantity {
+  &.money, &.quantity {
     width: 75px;
     text-align: right;
   }
index 77b5ae2..e79e463 100755 (executable)
@@ -2458,10 +2458,7 @@ body {
 .xv-list-column.third {
   width: 100px;
 }
-.xv-list-column.money {
-  width: 75px;
-  text-align: right;
-}
+.xv-list-column.money,
 .xv-list-column.quantity {
   width: 75px;
   text-align: right;
index fa91ff7..c825006 100644 (file)
@@ -25,7 +25,7 @@ trailing:true*/
    */
   var navigator = /** @lends XV.Navigator# */{
     name: "XV.Navigator",
-    kind: "XV.AppPanels",
+    kind: "XV.ContainerPanels",
     classes: 'xv-navigator',
     /**
       Published fields
@@ -118,6 +118,8 @@ trailing:true*/
           {name: "rightLabel", classes: "xv-toolbar-label"},
           // The MoreToolbar is a FittableColumnsLayout, so this spacer takes up all available space
           {name: "spacer", classes: "spacer", fit: true},
+          {kind: "font.TextIcon", name: "backPanelButton",
+            content: "_back".loc(), ontap: "backPanelTapped", icon: "chevron-left"},
           {kind: "font.TextIcon", name: "refreshButton",
             icon: "rotate-right", content: "_refresh".loc(),
             ontap: "requery", showing: false},
@@ -176,6 +178,9 @@ trailing:true*/
     activate: function () {
       this.setMenuPanel(MODULE_MENU);
     },
+    backPanelTapped: function () {
+      this.setIndex(0);
+    },
     /**
       The back button is a logout button if you're at the root menu. Otherwise it's a
       back button that takes you to the root menu.
@@ -1040,6 +1045,12 @@ trailing:true*/
         contentHeader.createComponents(panel.headerComponents);
         contentHeader.render();
       }
+
+      // If this is a mobile device and we're not selecting
+      // the welcome screen.
+      if (enyo.Panels.isScreenNarrow() && panelIndex) {
+        this.next();
+      }
     },
 
     /**
@@ -1059,6 +1070,8 @@ trailing:true*/
       this.buildMenus();
 
       this.$.backButton.setContent(label);
+      this.$.backPanelButton.setContent(label);
+      this.$.backPanelButton.setShowing(enyo.Panels.isScreenNarrow());
       this.$.refreshButton.setShowing(index);
       this.$.search.setShowing(index);
       this.$.contentToolbar.resized();
index 01e4b19..c132e21 100644 (file)
@@ -16,7 +16,7 @@ trailing:true, white:true*/
   enyo.kind(
     /** @lends XV.SearchContainer# */{
     name: "XV.SearchContainer",
-    kind: "XV.AppPanels",
+    kind: "XV.SearchPanels",
     classes: 'xv-search',
     /**
      * Published fields
index a69dfc2..f1b9ac3 100644 (file)
@@ -14,7 +14,7 @@ trailing:true, white:true, strict:false*/
    */
   var transactionListContainer =  /** @lends XV.TransactionListContainer# */ {
     name: "XV.TransactionListContainer",
-    kind: "XV.AppPanels",
+    kind: "XV.SearchPanels",
     classes: 'xv-search',
     published: {
       prerequisite: "",
index 3942e49..2fea6bd 100644 (file)
@@ -616,7 +616,7 @@ trailing:true, white:true, strict: false*/
    */
   enyo.kind(/** @lends XV.WorkspaceContainer# */{
     name: "XV.WorkspaceContainer",
-    kind: "XV.WorkspaceContainerPanels",
+    kind: "XV.ContainerPanels",
     classes: "xv-workspace-container",
     published: {
       menuItems: [],