Update list user editor (#1938)

This commit is contained in:
Ozzie Isaacs 2021-04-27 20:01:17 +02:00
parent 19797d5d23
commit de7f039b99
2 changed files with 101 additions and 128 deletions

View File

@ -130,16 +130,6 @@ $("#back").click(function() {
function confirmDialog(id, dialogid, dataValue, yesFn, noFn) {
var $confirm = $("#" + dialogid);
$confirm.modal('show');
$.ajax({
method:"get",
dataType: "json",
url: getPath() + "/ajax/loaddialogtexts/" + id,
success: function success(data) {
$("#header-"+ dialogid).html(data.header);
$("#text-"+ dialogid).html(data.main);
}
});
$("#btnConfirmYes-"+ dialogid).off('click').click(function () {
yesFn(dataValue);
$confirm.modal("hide");
@ -150,6 +140,16 @@ function confirmDialog(id, dialogid, dataValue, yesFn, noFn) {
}
$confirm.modal("hide");
});
$.ajax({
method:"get",
dataType: "json",
url: getPath() + "/ajax/loaddialogtexts/" + id,
success: function success(data) {
$("#header-"+ dialogid).html(data.header);
$("#text-"+ dialogid).html(data.main);
}
});
$confirm.modal('show');
}
$("#delete_confirm").click(function() {

View File

@ -19,6 +19,7 @@
/* global getPath, confirmDialog */
var selections = [];
var reload = false;
$(function() {
$("#books-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table",
@ -456,7 +457,6 @@ $(function() {
},
onLoadSuccess: function () {
loadSuccess();
move_header_elements();
},
onColumnSwitch: function () {
var visible = $("#user-table").bootstrapTable("getVisibleColumns");
@ -500,35 +500,6 @@ $(function() {
var func = $.inArray(e.type, ["check", "check-all"]) > -1 ? "union" : "difference";
selections = window._[func](selections, ids);
handle_header_buttons();
/*if (selections.length < 1) {
$("#user_delete_selection").addClass("disabled");
$("#user_delete_selection").attr("aria-disabled", true);
$(".check_head").attr("aria-disabled", true);
$(".check_head").attr("disabled", true);
$(".check_head").prop('checked', false);
$(".button_head").attr("aria-disabled", true);
$(".button_head").addClass("disabled");
$(".multi_head").attr("aria-disabled", true);
$(".multi_head").addClass("hidden");
$(".multi_selector").attr("aria-disabled", true);
$(".multi_selector").attr("disabled", true);
$('.multi_selector').selectpicker('deselectAll');
$('.multi_selector').selectpicker('refresh');
$(".header_select").attr("disabled", true);
} else {
$("#user_delete_selection").removeClass("disabled");
$("#user_delete_selection").attr("aria-disabled", false);
$(".check_head").attr("aria-disabled", false);
$(".check_head").removeAttr("disabled");
$(".button_head").attr("aria-disabled", false);
$(".button_head").removeClass("disabled");
$(".multi_head").attr("aria-disabled", false);
$(".multi_head").removeClass("hidden");
$(".multi_selector").attr("aria-disabled", false);
$(".multi_selector").removeAttr("disabled");
$('.multi_selector').selectpicker('refresh');
$(".header_select").removeAttr("disabled");
}*/
});
});
@ -545,8 +516,6 @@ function handle_header_buttons () {
$(".multi_head").addClass("hidden");
$(".multi_selector").attr("aria-disabled", true);
$(".multi_selector").attr("disabled", true);
$('.multi_selector').selectpicker('deselectAll');
$('.multi_selector').selectpicker('refresh');
$(".header_select").attr("disabled", true);
} else {
$("#user_delete_selection").removeClass("disabled");
@ -629,6 +598,11 @@ function loadSuccess() {
$(".header_select").each(function() {
$(this).prop("selectedIndex", 0);
});
$(".header_select").each(function() {
$(this).prop("selectedIndex", 0);
});
$('.multi_selector').selectpicker('deselectAll');
$('.multi_selector').selectpicker('refresh');
$(".editable[data-name='locale'][data-pk='"+guest.data("pk")+"']").editable("disable");
$(".editable[data-name='locale'][data-pk='"+guest.data("pk")+"']").hide();
$("input[data-name='admin_role'][data-pk='"+guest.data("pk")+"']").prop("disabled", true);
@ -727,7 +701,6 @@ function move_header_elements() {
}
);
});
}
function handleListServerResponse (data) {