summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/ajax.js9
1 files changed, 8 insertions, 1 deletions
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);
+ }
};
/**