forked from IceCreamYou/Drupal-Activity-Log
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivity_log.admin.js
More file actions
35 lines (35 loc) · 1.9 KB
/
activity_log.admin.js
File metadata and controls
35 lines (35 loc) · 1.9 KB
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
Drupal.behaviors.activityLogAdmin = function (context) {
// Make sure we can run context.find().
var ctxt = $(context);
var handle = function() {
var val = ctxt.find('input:radio[name="settings[grouping][group_method]"]:checked').val();
if (val == 'target_action') {
ctxt.find('#edit-settings-grouping-group-interval-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-max-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').hide();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-template-wrapper').show();
ctxt.find('#edit-settings-grouping-translation-templates-fieldset').show();
ctxt.find('#activity-log-admin-description').hide();
}
else if (val == 'action' || val == 'user_action') {
ctxt.find('#edit-settings-grouping-group-interval-wrapper').show();
ctxt.find('#edit-settings-grouping-group-max-wrapper').show();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').show();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').show();
ctxt.find('#edit-settings-grouping-group-template-wrapper').show();
ctxt.find('#edit-settings-grouping-translation-templates-fieldset').show();
ctxt.find('#activity-log-admin-description').show();
}
else if (val == 'none') {
ctxt.find('#edit-settings-grouping-group-interval-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-max-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-summary-wrapper').hide();
ctxt.find('#edit-settings-grouping-collapse-method-wrapper').hide();
ctxt.find('#edit-settings-grouping-group-template-wrapper').hide();
ctxt.find('#edit-settings-grouping-translation-templates-fieldset').hide();
}
};
handle();
ctxt.find('input:radio[name="settings[grouping][group_method]"]').change(handle);
}