forked from gkrid/dokuwiki-plugin-approve
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (25 loc) · 840 Bytes
/
script.js
File metadata and controls
29 lines (25 loc) · 840 Bytes
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
jQuery(function() {
"use strict";
var $groupInput = jQuery('#plugin__approve_group_input');
if ($groupInput.length === 0) return;
var $form = $groupInput.closest('form');
var $select = $form.find('select');
//Add option to select a group
var label = LANG['plugins']['approve']['group_option_label'];
if (label === '') {
label = 'Group:';
}
var $groupOption = jQuery('<option value="">' + label + '</option>')
.insertAfter($select.find('option:first-child'));
$groupInput.hide();
$select.on('change', function() {
var $option = $select.find(':selected');
if ($option.is($groupOption)) {
$groupInput.val('@');
$groupInput.show();
} else {
$groupInput.val('');
$groupInput.hide();
}
});
});