mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Make checkboxes in user permissions table editable
This commit is contained in:
parent
ae0c8a96f2
commit
ce7fa51465
1 changed files with 31 additions and 7 deletions
|
@ -232,6 +232,16 @@ $(document).ready(function(){
|
||||||
badgeSidebarForDifferences($(this));
|
badgeSidebarForDifferences($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Bootstrap switch in table
|
||||||
|
$('#' + Settings.FORM_ID).on('switchChange.bootstrapSwitch', 'input.toggle-checkbox', function () {
|
||||||
|
// Bootstrap switches in table: set the changed data attribute for all rows.
|
||||||
|
var row = $(this).closest('tr');
|
||||||
|
row.find('td.' + Settings.DATA_COL_CLASS + ' input').attr('data-changed', true);
|
||||||
|
updateDataChangedForSiblingRows(row, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.advanced-toggle').click(function(){
|
$('.advanced-toggle').click(function(){
|
||||||
Settings.showAdvanced = !Settings.showAdvanced
|
Settings.showAdvanced = !Settings.showAdvanced
|
||||||
var advancedSelector = $('.' + Settings.ADVANCED_CLASS)
|
var advancedSelector = $('.' + Settings.ADVANCED_CLASS)
|
||||||
|
@ -966,16 +976,30 @@ function makeTable(setting, keypath, setting_value, isLocked) {
|
||||||
colName = keypath + "." + rowIndexOrName + "." + col.name;
|
colName = keypath + "." + rowIndexOrName + "." + col.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup the td for this column
|
if (isArray && col.type === "checkbox") {
|
||||||
html += "<td class='" + Settings.DATA_COL_CLASS + "' name='" + colName + "'>";
|
|
||||||
|
|
||||||
// add the actual value to the td so it is displayed
|
html += "<td class='" + Settings.DATA_COL_CLASS + "'name='" + col.name + "'>"
|
||||||
html += colValue;
|
html += "<input type='checkbox' "
|
||||||
|
html += "class='form-control toggle-checkbox' "
|
||||||
|
html += "name='" + colName + "'"
|
||||||
|
html += (colValue ? " checked" : "")
|
||||||
|
html += " />"
|
||||||
|
html += "</td>"
|
||||||
|
|
||||||
// for values to be posted properly we add a hidden input to this td
|
} else {
|
||||||
html += "<input type='hidden' name='" + colName + "' value='" + colValue + "'/>";
|
|
||||||
|
// setup the td for this column
|
||||||
|
html += "<td class='" + Settings.DATA_COL_CLASS + "' name='" + colName + "'>";
|
||||||
|
|
||||||
|
// add the actual value to the td so it is displayed
|
||||||
|
html += colValue;
|
||||||
|
|
||||||
|
// for values to be posted properly we add a hidden input to this td
|
||||||
|
html += "<input type='hidden' name='" + colName + "' value='" + colValue + "'/>";
|
||||||
|
|
||||||
|
html += "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
html += "</td>";
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!isLocked && !setting.read_only) {
|
if (!isLocked && !setting.read_only) {
|
||||||
|
|
Loading…
Reference in a new issue