[BS5] add responsive tabs and more

This commit is contained in:
FreddleSpl0it
2022-06-06 20:38:24 +02:00
parent f13530d8a1
commit cb6a5d4069
67 changed files with 786 additions and 409 deletions

File diff suppressed because one or more lines are too long

View File

@@ -318,6 +318,7 @@ $(document).ready(function() {
// General API delete actions
$(document).on('click', "[data-action='delete_selected']", function(e) {
console.log("delete");
e.preventDefault();
var id = $(this).data('id');
// If clicked element #delete_selected has data-item attribute, it is added to "items"
@@ -336,6 +337,7 @@ $(document).ready(function() {
if (typeof multi_data[id] == "undefined" || multi_data[id] == "") return;
data_array = multi_data[id];
api_url = $(this).data('api-url');
console.log("delete modal");
$(document).on('show.bs.modal', '#ConfirmDeleteModal', function() {
$("#ItemsToDelete").empty();
for (var i in data_array) {
@@ -343,10 +345,7 @@ $(document).ready(function() {
$("#ItemsToDelete").append("<li>" + data_array[i] + "</li>");
}
})
$('#ConfirmDeleteModal').modal({
backdrop: 'static',
keyboard: false
})
$('#ConfirmDeleteModal').modal('show')
.one('click', '#IsConfirmed', function(e) {
if (is_active($('#IsConfirmed'))) { return false; }
$.ajax({

View File

@@ -61,8 +61,8 @@ $(document).ready(function() {
// remember last navigation pill
(function () {
'use strict';
if ($('a[data-bs-toggle="tab"]').length) {
$('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
if ($('button[data-bs-toggle="tab"]').length) {
$('button[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
if ($(this).data('dont-remember') == 1) {
return true;
}
@@ -71,7 +71,7 @@ $(document).ready(function() {
if (id) {
key += ':' + id;
}
localStorage.setItem(key, $(e.target).attr('href'));
localStorage.setItem(key, $(e.target).attr('data-bs-target').substring(1));
});
$('[role="tablist"]').each(function (idx, elem) {
var id = $(elem).attr('id');
@@ -81,7 +81,7 @@ $(document).ready(function() {
}
var lastTab = localStorage.getItem(key);
if (lastTab) {
$('[href="' + lastTab + '"]').tab('show');
$("[id^=" + lastTab + "]").show();
}
});
}