vertical_tabs_example.js 788 B

1234567891011121314151617181920212223
  1. (function ($) {
  2. /**
  3. * Update the summary for the module's vertical tab.
  4. */
  5. Drupal.behaviors.vertical_tabs_exampleFieldsetSummaries = {
  6. attach: function (context) {
  7. // Use the fieldset class to identify the vertical tab element
  8. $('fieldset#edit-vertical-tabs-example', context).drupalSetSummary(function (context) {
  9. // Depending on the checkbox status, the settings will be customized, so
  10. // update the summary with the custom setting textfield string or a use a
  11. // default string.
  12. if ($('#edit-vertical-tabs-example-enabled', context).attr('checked')) {
  13. return Drupal.checkPlain($('#edit-vertical-tabs-example-custom-setting', context).val());
  14. }
  15. else {
  16. return Drupal.t('Using default');
  17. }
  18. });
  19. }
  20. };
  21. })(jQuery);