Issue #23590: GridBox line items add on enter
authorLinda Nichols <lynnaloo@gmail.com>
Sun, 11 May 2014 22:00:00 +0000 (22:00 +0000)
committerLinda Nichols <lynnaloo@gmail.com>
Sun, 11 May 2014 22:00:00 +0000 (22:00 +0000)
lib/enyo-x/source/core.js
lib/enyo-x/source/less/screen.less
lib/enyo-x/source/stylesheets/screen.css
lib/enyo-x/source/views/grid_box.js

index e46e0df..2ff84e0 100644 (file)
@@ -22,6 +22,7 @@ trailing:true, white:true, strict: false*/
     KEY_UP: 38,
     KEY_DOWN: 40,
     KEY_TAB: 9,
+    KEY_ENTER: 13,
 
     /**
       Key/value mapping of widget class names that correspond with object definitions
index 24c7b29..d169970 100644 (file)
@@ -337,6 +337,7 @@ body {
   }
 
   .xv-toolbar-label, .xv-search {
+    color: @white;
     width: @searchLength;
     margin: 0;
     margin-left: 6px;
index c9d8752..727887c 100755 (executable)
@@ -1795,6 +1795,7 @@ body {
 }
 .onyx-toolbar .xv-toolbar-label,
 .onyx-toolbar .xv-search {
+  color: #fdfdfd;
   width: 185px;
   margin: 0;
   margin-left: 6px;
index cdafc25..35b9ab9 100644 (file)
@@ -146,11 +146,7 @@ trailing:true, white:true, strict: false*/
       value: null
     },
     addButtonKeyup: function (inSender, inEvent) {
-      if (inEvent.keyCode === XV.KEY_TAB) {
-        // the user has just tabbed out of their row
-        this.bubble("onTabOut");
-        return true;
-      }
+      inEvent.preventDefault();
     },
     create: function () {
       this.inherited(arguments);
@@ -179,17 +175,18 @@ trailing:true, white:true, strict: false*/
             {kind: "enyo.Button",
               classes: "icon-plus xv-gridbox-button",
               name: "addGridRowButton",
-              onkeyup: "addButtonKeyup" },
-            {kind: "enyo.Button", attributes: {tabIndex: "-1"},
+              onkeypress: "addButtonKeyup",
+            },
+            {kind: "enyo.Button",
               classes: "icon-folder-open xv-gridbox-button",
               name: "expandGridRowButton" },
-            {kind: "enyo.Button", attributes: {tabIndex: "-1"},
+            {kind: "enyo.Button",
               classes: "icon-remove-sign xv-gridbox-button",
               name: "deleteGridRowButton" }
           ]}
         ]}
       );
-      this.createComponents(components);
+      this.createComponents(components, {owner: this});
     },
     keyUp: function (inSender, inEvent) {
       if (inEvent.keyCode === XV.KEY_DOWN) {
@@ -198,6 +195,9 @@ trailing:true, white:true, strict: false*/
       } else if (inEvent.keyCode === XV.KEY_UP) {
         this.doMoveUp(inEvent);
         return true;
+      } else if (inEvent.keyCode === XV.KEY_ENTER) {
+        this.doEnterOut(inEvent);
+        return true;
       }
     },
     /**
@@ -221,7 +221,8 @@ trailing:true, white:true, strict: false*/
   });
   _.extend(editor.events, {
       onMoveUp: "",
-      onMoveDown: ""
+      onMoveDown: "",
+      onEnterOut: ""
     });
   _.extend(editor.handlers, {
       onkeyup: "keyUp"
@@ -242,7 +243,7 @@ trailing:true, white:true, strict: false*/
     },
     handlers: {
       ontap: "buttonTapped",
-      onTabOut: "tabOut",
+      onEnterOut: "enterOut",
       onMoveUp: "moveUp",
       onMoveDown: "moveDown"
     },
@@ -550,7 +551,7 @@ trailing:true, white:true, strict: false*/
 
       return true;
     },
-    tabOut: function (inSender, inEvent) {
+    enterOut: function (inSender, inEvent) {
       inEvent.wrap = true;
       this.moveDown(inSender, inEvent);
     },