Fix #16482 - Select All link for table-specific privileges
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
This commit is contained in:
parent
fe4e1d4192
commit
3ea7d86684
@ -413,6 +413,25 @@ AJAX.registerOnload('server/privileges.js', function () {
|
||||
addOrUpdateSubmenu();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select all privileges
|
||||
*
|
||||
* @param {HTMLElement} e
|
||||
* @return {void}
|
||||
*/
|
||||
var tableSelectAll = function (e) {
|
||||
const method = e.target.getAttribute('data-select-target');
|
||||
var options = $(method).first().children();
|
||||
options.each(function (_, obj) {
|
||||
obj.selected = true;
|
||||
});
|
||||
};
|
||||
|
||||
$('#select_priv_all').on('click', tableSelectAll);
|
||||
$('#insert_priv_all').on('click', tableSelectAll);
|
||||
$('#update_priv_all').on('click', tableSelectAll);
|
||||
$('#references_priv_all').on('click', tableSelectAll);
|
||||
|
||||
var windowWidth = $(window).width();
|
||||
$('.jsresponsive').css('max-width', (windowWidth - 35) + 'px');
|
||||
|
||||
|
||||
@ -23,6 +23,12 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-link p-0" id="select_priv_all" type="button" data-select-target="#select_select_priv">
|
||||
{% trans 'Select all' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<em>{% trans 'Or' %}</em>
|
||||
<label for="checkbox_Select_priv_none">
|
||||
<input type="checkbox" name="Select_priv_none" id="checkbox_Select_priv_none" title="
|
||||
@ -44,6 +50,12 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-link p-0" id="insert_priv_all" type="button" data-select-target="#select_insert_priv">
|
||||
{% trans 'Select all' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<em>{% trans 'Or' %}</em>
|
||||
<label for="checkbox_Insert_priv_none">
|
||||
<input type="checkbox" name="Insert_priv_none" id="checkbox_Insert_priv_none" title="
|
||||
@ -65,6 +77,12 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-link p-0" id="update_priv_all" type="button" data-select-target="#select_update_priv">
|
||||
{% trans 'Select all' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<em>{% trans 'Or' %}</em>
|
||||
<label for="checkbox_Update_priv_none">
|
||||
<input type="checkbox" name="Update_priv_none" id="checkbox_Update_priv_none" title="
|
||||
@ -86,6 +104,12 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-link p-0" id="references_priv_all" type="button" data-select-target="#select_references_priv">
|
||||
{% trans 'Select all' %}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<em>{% trans 'Or' %}</em>
|
||||
<label for="checkbox_References_priv_none">
|
||||
<input type="checkbox" name="References_priv_none" id="checkbox_References_priv_none" title="
|
||||
|
||||
Loading…
Reference in New Issue
Block a user