summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-10-04 17:46:01 +0000
committerDries Buytaert <dries@buytaert.net>2010-10-04 17:46:01 +0000
commit5a23b3fdb970bb0c3e79f47ba9296455d237d9f0 (patch)
treeb9e59f7bdb1ffbbdc569c34f56980aba267ca3fa /misc
parenta50d47f9591d240f212b66332e25d7f2ce50369d (diff)
downloadbrdo-5a23b3fdb970bb0c3e79f47ba9296455d237d9f0.tar.gz
brdo-5a23b3fdb970bb0c3e79f47ba9296455d237d9f0.tar.bz2
- Patch #561858 by effulgentsia, sun, rfay, Nick_vh, merlinofchaos, katbailey, dereine, tstoeckler: drupal_add_js() and drupal_add_css() to work for AJAX requests too by adding lazy-load to AJAX framework.
Diffstat (limited to 'misc')
-rw-r--r--misc/ajax.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/ajax.js b/misc/ajax.js
index 616195463..87f567fcd 100644
--- a/misc/ajax.js
+++ b/misc/ajax.js
@@ -231,6 +231,17 @@ Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) {
form_values.push({ name: 'ajax_html_ids[]', value: this.id });
});
+ // Allow Drupal to return new JavaScript and CSS files to load without
+ // returning the ones already loaded.
+ form_values.push({ name: 'ajax_page_state[theme]', value: Drupal.settings.ajaxPageState.theme });
+ form_values.push({ name: 'ajax_page_state[theme_token]', value: Drupal.settings.ajaxPageState.themeToken });
+ for (var key in Drupal.settings.ajaxPageState.css) {
+ form_values.push({ name: 'ajax_page_state[css][' + key + ']', value: 1 });
+ }
+ for (var key in Drupal.settings.ajaxPageState.js) {
+ form_values.push({ name: 'ajax_page_state[js][' + key + ']', value: 1 });
+ }
+
// Insert progressbar or throbber.
if (this.progress.type == 'bar') {
var progressBar = new Drupal.progressBar('ajax-progress-' + this.element.id, eval(this.progress.update_callback), this.progress.method, eval(this.progress.error_callback));