1 |
85ad3d82
|
Assos Assos
|
(function ($) {
|
2 |
|
|
|
3 |
|
|
Drupal.behaviors.fileDisplayStatus = {
|
4 |
|
|
attach: function (context, settings) {
|
5 |
|
|
$('#file-displays-status-wrapper input.form-checkbox', context).once('display-status', function () {
|
6 |
|
|
var $checkbox = $(this);
|
7 |
|
|
|
8 |
|
|
var $row = $('#' + $checkbox.attr('id').replace(/-status$/, '-weight'), context).closest('tr');
|
9 |
|
|
|
10 |
|
|
var tab = $('#' + $checkbox.attr('id').replace(/-status$/, '-settings'), context).data('verticalTab');
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
$checkbox.bind('click.displayStatusUpdate', function () {
|
15 |
|
|
if ($checkbox.is(':checked')) {
|
16 |
|
|
$row.show();
|
17 |
|
|
if (tab) {
|
18 |
|
|
tab.tabShow().updateSummary();
|
19 |
|
|
}
|
20 |
|
|
}
|
21 |
|
|
else {
|
22 |
|
|
$row.hide();
|
23 |
|
|
if (tab) {
|
24 |
|
|
tab.tabHide().updateSummary();
|
25 |
|
|
}
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
Drupal.tableDrag['file-displays-order'].restripeTable();
|
29 |
|
|
});
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
if (tab) {
|
33 |
|
|
tab.fieldset.drupalSetSummary(function (tabContext) {
|
34 |
|
|
return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled');
|
35 |
|
|
});
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
$checkbox.triggerHandler('click.displayStatusUpdate');
|
40 |
|
|
});
|
41 |
|
|
}
|
42 |
|
|
};
|
43 |
|
|
|
44 |
|
|
})(jQuery); |