Fix #4
Mistakenly used JS from Bootstrap 4 instead of the needed version 3.3.7; thereby the modal wasn't displayed correctly
This commit is contained in:
parent
d7f7a49a24
commit
c3561b22e8
|
@ -12,11 +12,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/assets/js/lib/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
|
||||
<?php
|
||||
$scripts = [
|
||||
'lib/jquery.min.js',
|
||||
'lib/popper.min.js',
|
||||
'lib/bootstrap.min.js',
|
||||
'lib/bootstrap-3.3.7.min.js',
|
||||
'lib/typeahead.bundle.min.js',
|
||||
'lib/datatables.js',
|
||||
'lib/jquery.tagsinput.min.js',
|
||||
|
|
|
@ -147,3 +147,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -418,41 +418,41 @@ var deletePost = function (id) {
|
|||
});
|
||||
};
|
||||
|
||||
// $('#deleteModal').on('show.bs.modal', function (event) {
|
||||
// var button = $(event.relatedTarget);
|
||||
// var type = button.data('type');
|
||||
// var title = button.data('title');
|
||||
// var id = button.data('id');
|
||||
//
|
||||
// var modal = $(this);
|
||||
// modal.find('.modal-body').html("<div class='alert alert-danger'><b>Durch das Klicken auf den Bestätigungs-Button wird der/die/das " + type + " <b>unwiederruflich</b> gelöscht und kann nicht wiederhergestellt werden!</b></div><p>Diese Aktion kann <b>NICHT</b> rückgängig gemacht werden. Dies wird alle Kommentare, Statistiken, Likes und Inhalte von <b>" + title + "</b> unwiederruflich löschen.</p><p>Bitte gib zur Bestätigung den Titel des Eintrags unter Berücksichtigung der Groß- und Kleinschreibung ein:</p><input class='form-control' id='confirm-delete-input' data-title='" + title + "'>");
|
||||
// modal.find('.modal-footer .btn-red').attr('disabled', '');
|
||||
// $('#confirm-delete-input').keyup(function () {
|
||||
// var removeButton = $('.modal-footer .btn-red', '#deleteModal');
|
||||
// if ($(this).val() == title) {
|
||||
// removeButton.removeAttr('disabled');
|
||||
// switch (type) {
|
||||
// case "Blog-Post":
|
||||
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")');
|
||||
// break;
|
||||
// case "Projekt":
|
||||
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")');
|
||||
// break;
|
||||
// case "Projekt-Kategorie":
|
||||
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")');
|
||||
// break;
|
||||
// case "Datei":
|
||||
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")');
|
||||
// break;
|
||||
// }
|
||||
// removeButton.css('cursor', 'pointer');
|
||||
// } else {
|
||||
// removeButton.attr('disabled', '');
|
||||
// removeButton.removeAttr('onclick');
|
||||
// removeButton.css('cursor', 'auto');
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
$('#deleteModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
var type = button.data('type');
|
||||
var title = button.data('title');
|
||||
var id = button.data('id');
|
||||
|
||||
var modal = $(this);
|
||||
modal.find('.modal-body').html("<div class='alert alert-danger'><b>Durch das Klicken auf den Bestätigungs-Button wird der/die/das " + type + " <b>unwiederruflich</b> gelöscht und kann nicht wiederhergestellt werden!</b></div><p>Diese Aktion kann <b>NICHT</b> rückgängig gemacht werden. Dies wird alle Kommentare, Statistiken, Likes und Inhalte von <b>" + title + "</b> unwiederruflich löschen.</p><p>Bitte gib zur Bestätigung den Titel des Eintrags unter Berücksichtigung der Groß- und Kleinschreibung ein:</p><input class='form-control' id='confirm-delete-input' data-title='" + title + "'>");
|
||||
modal.find('.modal-footer .btn-red').attr('disabled', '');
|
||||
$('#confirm-delete-input').keyup(function () {
|
||||
var removeButton = $('.modal-footer .btn-red', '#deleteModal');
|
||||
if ($(this).val() == title) {
|
||||
removeButton.removeAttr('disabled');
|
||||
switch (type) {
|
||||
case "Blog-Post":
|
||||
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")');
|
||||
break;
|
||||
case "Projekt":
|
||||
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")');
|
||||
break;
|
||||
case "Projekt-Kategorie":
|
||||
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")');
|
||||
break;
|
||||
case "Datei":
|
||||
removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")');
|
||||
break;
|
||||
}
|
||||
removeButton.css('cursor', 'pointer');
|
||||
} else {
|
||||
removeButton.attr('disabled', '');
|
||||
removeButton.removeAttr('onclick');
|
||||
removeButton.css('cursor', 'auto');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function deletePostFinally(id, url, selector) {
|
||||
var row = $("#" + selector + "-" + id);
|
||||
|
|
Reference in New Issue
Block a user