From 33f6c5608c62b27fa86d52e8806435a6c94f3eee Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 29 Jun 2011 22:40:21 -0700 Subject: Issue #634616 by effulgentsia, rfay, sun: Fixed Various problems due to AJAX binding to mousedown instead of click. --- misc/ajax.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/ajax.js b/misc/ajax.js index fb03e2b30..830c8aa1c 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -182,10 +182,17 @@ Drupal.ajax = function (base, element, element_settings) { // can be triggered through keyboard input as well as e.g. a mousedown // action. if (element_settings.keypress) { - $(element_settings.element).keypress(function (event) { + $(ajax.element).keypress(function (event) { return ajax.keypressResponse(this, event); }); } + + // If necessary, prevent the browser default action of an additional event. + // For example, prevent the browser default action of a click, even if the + // AJAX behavior binds to mousedown. + if (element_settings.prevent) { + $(ajax.element).bind(element_settings.prevent, false); + } }; /** -- cgit v1.2.3