ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject git commit: AMBARI-6123. Issues with dialog keypresses.(xiwang)
Date Fri, 13 Jun 2014 23:58:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ec0c81a9c -> f88b9dd98


AMBARI-6123. Issues with dialog keypresses.(xiwang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f88b9dd9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f88b9dd9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f88b9dd9

Branch: refs/heads/trunk
Commit: f88b9dd9824ba942501a4d4fa24801905597cfe9
Parents: ec0c81a
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Jun 13 16:10:08 2014 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Jun 13 16:58:12 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/views/application.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f88b9dd9/ambari-web/app/views/application.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/application.js b/ambari-web/app/views/application.js
index afe38f2..8b9958f 100644
--- a/ambari-web/app/views/application.js
+++ b/ambari-web/app/views/application.js
@@ -27,9 +27,10 @@ App.ApplicationView = Em.View.extend({
     // on 'Esc' pressed, close the modal
     $(document).keydown(function(event){
       if (event.which == 13 || event.keyCode == 13 ) {
-        var primaryButton = $(document).find('#modal > .modal-footer > .btn-success').first();
+        event.preventDefault();
+        event.stopPropagation();
+        var primaryButton = $(document).find('#modal > .modal-footer > .btn-success').last();
         if (primaryButton.length > 0 && primaryButton.attr('disabled') != 'disabled')
{
-          event.preventDefault();
           primaryButton.click();
           return false;
         }
@@ -38,9 +39,10 @@ App.ApplicationView = Em.View.extend({
     });
     $(document).keyup(function(event){
       if (event.which == 27 || event.keyCode == 27) {
-        var closeButton = $(document).find('#modal > .modal-header > .close').first();
+        event.preventDefault();
+        event.stopPropagation();
+        var closeButton = $(document).find('#modal > .modal-header > .close').last();
         if (closeButton.length > 0) {
-          event.preventDefault();
           closeButton.click();
           return false;
         }


Mime
View raw message