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