summaryrefslogtreecommitdiff
path: root/modules/comment/comment.js
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/comment/comment.js
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/comment/comment.js')
-rw-r--r--modules/comment/comment.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/comment/comment.js b/modules/comment/comment.js
index 96ecbaf5d..69baf7423 100644
--- a/modules/comment/comment.js
+++ b/modules/comment/comment.js
@@ -1,15 +1,16 @@
// $Id$
-if (Drupal.jsEnabled) {
- $(document).ready(function() {
- var parts = new Array("name", "homepage", "mail");
- var cookie = '';
- for (i=0;i<3;i++) {
- cookie = Drupal.comment.getCookie('comment_info_' + parts[i]);
- if (cookie != '') {
- $("#comment-form input[@name=" + parts[i] + "]").val(cookie);
- }
+
+Drupal.behaviors.comment = function (context) {
+ var parts = new Array("name", "homepage", "mail");
+ var cookie = '';
+ for (i=0;i<3;i++) {
+ cookie = Drupal.comment.getCookie('comment_info_' + parts[i]);
+ if (cookie != '') {
+ $("#comment-form input[@name=" + parts[i] + "]:not(.comment-processed)", context)
+ .val(cookie)
+ .addClass('comment-processed');
}
- });
+ }
};
Drupal.comment = {};