The branch, master has been updated
       via  f25ce4c3f851006d61699d23b74fd802ea0a048f (commit)
      from  eb049c922a6dee46b75da3b3c127d85cb2b2a523 (commit)


- Log -----------------------------------------------------------------
commit f25ce4c3f851006d61699d23b74fd802ea0a048f
Author: Alex Marin <[email protected]>
Date:   Mon Jan 23 12:56:21 2012 -0500

    bug 3464377 Cannot press enter on the VARIABLE field of a bookmark

-----------------------------------------------------------------------

Summary of changes:
 js/sql.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/js/sql.js b/js/sql.js
index a07d7e7..6f00c75 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -136,6 +136,31 @@ $(document).ready(function() {
         $form.find("select[name=id_bookmark]").attr("value","");
         // let normal event propagation happen
     });
+  
+    /**
+     * Event handler for hitting enter on sqlqueryform bookmark_variable
+     * (the Variable textfield in Bookmarked SQL query section)
+     *
+     * @memberOf    jQuery
+     */
+    $("input[name=bookmark_variable]").bind("keypress", function(event) {
+        // force the 'Enter Key' to implicitly click the 
#button_submit_bookmark
+        var keycode = (event.keyCode ? event.keyCode : (event.which ? 
event.which : event.charCode));
+        if (keycode == 13) { // keycode for enter key
+            // When you press enter in the sqlqueryform, which
+            // has 2 submit buttons, the default is to run the
+            // #button_submit_query, because of the tabindex 
+            // attribute. 
+            // This submits #button_submit_bookmark instead,
+            // because when you are in the Bookmarked SQL query
+            // section and hit enter, you expect it to do the
+            // same action as the Go button in that section.
+            $("#button_submit_bookmark").click();
+           return false;
+        } else  {
+           return true;
+        }
+    });
 
     /**
      * Ajax Event handler for 'SQL Query Submit'


hooks/post-receive
-- 
phpMyAdmin

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git

Reply via email to