This commit is contained in:
cbartondock 2021-04-28 08:43:44 -04:00
commit c2c4636961
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) { function confirmDialog(id, dialogid, dataValue, yesFn, noFn) {
var $confirm = $("#" + dialogid); 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 () { $("#btnConfirmYes-"+ dialogid).off('click').click(function () {
yesFn(dataValue); yesFn(dataValue);
$confirm.modal("hide"); $confirm.modal("hide");
@ -150,6 +140,16 @@ function confirmDialog(id, dialogid, dataValue, yesFn, noFn) {
} }
$confirm.modal("hide"); $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() { $("#delete_confirm").click(function() {

View File

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