| 1 |
// $Id: jquery_ui.js,v 1.1 2009/06/19 20:53:26 robloach Exp $
|
| 2 |
|
| 3 |
(function ($) {
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* Provides the jQuery UI Drupal behaviors.
|
| 8 |
*/
|
| 9 |
|
| 10 |
/**
|
| 11 |
* The jQuery UI Drupal behavior.
|
| 12 |
*
|
| 13 |
* This will go through all widgets and apply them to the given selectors with
|
| 14 |
* the appropriate arguments.
|
| 15 |
*/
|
| 16 |
Drupal.behaviors.jqueryui = {
|
| 17 |
attach: function(context, settings) {
|
| 18 |
if (settings.jqueryui) {
|
| 19 |
// Iterate through each widget and apply the tool to the elements.
|
| 20 |
jQuery.each(settings.jqueryui, function(ui, elements) {
|
| 21 |
// Iterate through each jQuery UI tool and apply the effects.
|
| 22 |
jQuery.each(elements, function(selector, options) {
|
| 23 |
// Apply the jQuery UI's effect.
|
| 24 |
$(selector + ':not(.jqueryui-' + ui + '-processed)', context).addClass('jqueryui-' + ui + '-processed')[ui](options);
|
| 25 |
});
|
| 26 |
});
|
| 27 |
}
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
})(jQuery);
|