summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-01 15:37:10 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-01 15:37:10 +0000
commitc11cb4ec24479e801076c094f043f2084b344d0c (patch)
tree5248d25917032a394ec350b65ebde88259168ffe /modules/user
parenta3d75e547f62174fe9fa2b5c3f9684b620612b00 (diff)
downloadbrdo-c11cb4ec24479e801076c094f043f2084b344d0c.tar.gz
brdo-c11cb4ec24479e801076c094f043f2084b344d0c.tar.bz2
- Patch #120360 by nedjo: enable AJAX by making all behaviours reattachable.
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/modules/user/user.js b/modules/user/user.js
index cbd46c992..bdfa06b43 100644
--- a/modules/user/user.js
+++ b/modules/user/user.js
@@ -4,11 +4,10 @@
* Attach handlers to evaluate the strength of any password fields and to check
* that its confirmation is correct.
*/
-Drupal.passwordAttach = function(context) {
- var context = context || $(document);
+Drupal.behaviors.password = function(context) {
var translate = Drupal.settings.password;
- $("input.password-field", context).each(function() {
- var passwordInput = $(this);
+ $("input.password-field:not(.password-processed)", context).each(function() {
+ var passwordInput = $(this).addClass('password-processed');
var parent = $(this).parent();
// Wait this number of milliseconds before checking password.
var monitorDelay = 700;
@@ -173,11 +172,9 @@ Drupal.evaluatePasswordStrength = function(value) {
* picture-related form elements depending on the current value of the
* "Picture support" radio buttons.
*/
-if (Drupal.jsEnabled) {
- $(document).ready(function () {
- $('div.user-admin-picture-radios input[@type=radio]').click(function () {
- $('div.user-admin-picture-settings')[['hide', 'show'][this.value]]();
- });
- Drupal.passwordAttach();
+Drupal.behaviors.userSettings = function (context) {
+ $('div.user-admin-picture-radios input[@type=radio]:not(.userSettings-processed)', context).addClass('userSettings-processed').click(function () {
+ $('div.user-admin-picture-settings', context)[['hide', 'show'][this.value]]();
});
-}
+};
+