Precision patch ported from this issue

Removed only the:
ctools_ajax_command_data - implementation for $.data jquery data cache attachments. see jQuery explanation

Being able to access the jQuery data chache makes it possible to transfer element specific data from server to client through the powerful command system. This simplifies trying to store unique values per element in Drupal.settings.

Rolled against head, your comments welcome.

CommentFileSizeAuthor
data_command-HEAD.patch2.15 KBnickl

Comments

merlinofchaos’s picture

I was completely unaware of the data functionality in jquery. This looks potentially very, very useful. I've committed this.

Can we take this a step farther?

I see a real value in 'ctools_add_data($selector, $key, $value)' that would store this globally.

If theme('page') is called, a hook_preprocess_page() would append javascript to the $scripts variable.
If ctools_ajax_render() is called, the data would automatically be placed here.

We could theoretically do these with some other commands too, but using this system we could completely forego settings for anything we think will be used with AJAX and just use this data() model and things will Just Work with or without ajax.

merlinofchaos’s picture

Status: Needs review » Fixed

I appear to have committed this but not marked the issue fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.