瀏覽代碼

AMBARI-419. Add Basic Keyboard Action Support For HMC UI (Contributed by Varun)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347222 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 年之前
父節點
當前提交
2593872088
共有 3 個文件被更改,包括 21 次插入1 次删除
  1. 2 0
      CHANGES.txt
  2. 1 1
      hmc/html/bootstrapJs.htmli
  3. 18 0
      hmc/js/installationWizard.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-419. Add Basic Keyboard Action Support For HMC UI (Varun via Vikram)
+
   AMBARI-418. Remove Redundant Titles From Reconfigure Panel (Varun via Vikram)
 
   AMBARI-416. Fix Inconsistent Validation Error Messages (Varun via Vikram)

+ 1 - 1
hmc/html/bootstrapJs.htmli

@@ -28,7 +28,7 @@
     "node", "io", "dump", "json", "panel", "event", "arraysort", 
     "array-extras", "datasource", "datasource-io", "datasource-jsonschema", 
     "datasource-polling", "stylesheet", "dd-drop", "dd-constrain",
-    "dd-proxy", "transition", function (Y) {
+    "dd-proxy", "transition", "node-event-simulate", function (Y) {
 
       /* Kick off the sequential loading. */
       loadNextJsFile();

+ 18 - 0
hmc/js/installationWizard.js

@@ -83,3 +83,21 @@ globalYui.one('#installationWizardProgressBarListId').delegate('click', function
     InstallationWizardStages.transitionToCachedStage( previouslyCurrentStage.get('id'), newCurrentStage.get('id') );
   }
 }, 'li' ); 
+
+globalYui.one('#installationMainFormsDivId').delegate('key', function (e) {
+    /* Prevent the refresh of the page. */
+    e.preventDefault();
+
+    /* We don't have identically structured markup around all our 
+     * 'a.btn' elements, so we need this bubble-up search logic. 
+     */
+    var currentButtonSibling = e.target.ancestor();
+
+    while( !currentButtonSibling.next('a.btn') ) {
+      currentButtonSibling = currentButtonSibling.ancestor();
+    }
+
+    /* Generate the click. */
+    currentButtonSibling.next('a.btn').simulate('click');
+
+}, 'enter' );