github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 235
    • 26
  • Source
  • Commits
  • Network (26)
  • Graphs
  • Tree: 1ddd4f5

click here to add a description

click here to add a homepage

  • Switch Branches (4)
    • bind
    • master
    • panel
    • tooltip
  • Switch Tags (15)
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Menu: pass the original event to the select callback.

Fixes #5343 - Add option to allow form submission when option is chosen.
scottgonzalez (author)
Sat Mar 20 13:17:56 -0700 2010
commit  1ddd4f5d3f83e1612cdbcf7039d01619b62c8a05
tree    2eb7f445e48cfe05f595ca7cd28cacc8c89f2dfc
parent  c61bd8ec67d9a863a00ae9d188993680f83186b0
M ui/jquery.ui.autocomplete.js 14 ••••
0
ui/jquery.ui.autocomplete.js
...
60
61
62
63
 
64
65
66
...
334
335
336
337
338
 
 
339
340
341
342
343
 
 
344
345
346
...
481
482
483
484
485
 
 
486
487
488
...
60
61
62
 
63
64
65
66
...
334
335
336
 
 
337
338
339
340
341
 
 
342
343
344
345
346
...
481
482
483
 
 
484
485
486
487
488
0
@@ -60,7 +60,7 @@ $.widget( "ui.autocomplete", {
0
           if ( !self.menu.active ) {
0
             return;
0
           }
0
-          self.menu.select();
0
+          self.menu.select( event );
0
           break;
0
         case keyCode.ESCAPE:
0
           self.element.val( self.term );
0
@@ -334,13 +334,13 @@ $.widget("ui.menu", {
0
         role: "listbox",
0
         "aria-activedescendant": "ui-active-menuitem"
0
       })
0
-      .click(function(e) {
0
-        if ( !$( e.target ).closest( ".ui-menu-item" ).length ) {
0
+      .click(function( event ) {
0
+        if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
0
           return;
0
         }
0
         // temporary
0
-        e.preventDefault();
0
-        self.select();
0
+        event.preventDefault();
0
+        self.select( event );
0
       });
0
     this.refresh();
0
   },
0
@@ -481,8 +481,8 @@ $.widget("ui.menu", {
0
     return this.element.height() < this.element.attr("scrollHeight");
0
   },
0
 
0
-  select: function() {
0
-    this._trigger("selected", null, { item: this.active });
0
+  select: function( event ) {
0
+    this._trigger("selected", event, { item: this.active });
0
   }
0
 });
0
 

Comments

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server