facetapi.admin.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. (function ($) {
  2. Drupal.behaviors.facetapi = {
  3. attach: function(context, settings) {
  4. // Ensures ALL soft limit select boxes are updated.
  5. // @see http://drupal.org/node/735528
  6. $('select[name="soft_limit"]').change(function() {
  7. $('select[name="soft_limit"]').val($(this).val());
  8. });
  9. // Ensures ALL nofollow checkboxes are updated.
  10. // @see http://drupal.org/node/735528
  11. $('input[name="nofollow"]').change(function() {
  12. if ($(this).attr('checked')) {
  13. $('input[name="nofollow"]').attr('checked', 'checked');
  14. }
  15. else {
  16. $('input[name="nofollow"]').removeAttr('checked');
  17. }
  18. });
  19. // Ensures ALL show expanded checkboxes are updated.
  20. // @see http://drupal.org/node/735528
  21. $('input[name="show_expanded"]').change(function() {
  22. if ($(this).attr('checked')) {
  23. $('input[name="show_expanded"]').attr('checked', 'checked');
  24. }
  25. else {
  26. $('input[name="show_expanded"]').removeAttr('checked');
  27. }
  28. });
  29. // Handles bug where input format fieldset is not hidden.
  30. // @see http://drupal.org/node/997826
  31. if ($('select[name="empty_behavior"]').val() != 'text') {
  32. $('fieldset#edit-empty-text-format').hide();
  33. }
  34. $('select[name="empty_behavior"]').change(function() {
  35. if ($(this).val() != 'text') {
  36. $('fieldset#edit-empty-text-format').hide();
  37. }
  38. else {
  39. $('fieldset#edit-empty-text-format').show();
  40. }
  41. });
  42. }
  43. }
  44. })(jQuery);