summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 22:40:21 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 22:40:21 -0700
commit33f6c5608c62b27fa86d52e8806435a6c94f3eee (patch)
tree093b712306c925fa6956b069fb64b82b4b03573b /misc
parent8b913661cd4567583f514d8bc87ba220e7e05de2 (diff)
downloadbrdo-33f6c5608c62b27fa86d52e8806435a6c94f3eee.tar.gz
brdo-33f6c5608c62b27fa86d52e8806435a6c94f3eee.tar.bz2
Issue #634616 by effulgentsia, rfay, sun: Fixed Various problems due to AJAX binding to mousedown instead of click.
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);
+ }
};
/**