Archived
1
0
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:
Marcel 2018-10-18 17:56:46 +02:00
parent d7f7a49a24
commit c3561b22e8
3 changed files with 41 additions and 38 deletions

View File

@ -12,11 +12,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</div> </div>
</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 <?php
$scripts = [ $scripts = [
'lib/jquery.min.js', 'lib/jquery.min.js',
'lib/popper.min.js', 'lib/bootstrap-3.3.7.min.js',
'lib/bootstrap.min.js',
'lib/typeahead.bundle.min.js', 'lib/typeahead.bundle.min.js',
'lib/datatables.js', 'lib/datatables.js',
'lib/jquery.tagsinput.min.js', 'lib/jquery.tagsinput.min.js',

View File

@ -146,4 +146,5 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -418,41 +418,41 @@ var deletePost = function (id) {
}); });
}; };
// $('#deleteModal').on('show.bs.modal', function (event) { $('#deleteModal').on('show.bs.modal', function (event) {
// var button = $(event.relatedTarget); var button = $(event.relatedTarget);
// var type = button.data('type'); var type = button.data('type');
// var title = button.data('title'); var title = button.data('title');
// var id = button.data('id'); var id = button.data('id');
//
// var modal = $(this); 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-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', ''); modal.find('.modal-footer .btn-red').attr('disabled', '');
// $('#confirm-delete-input').keyup(function () { $('#confirm-delete-input').keyup(function () {
// var removeButton = $('.modal-footer .btn-red', '#deleteModal'); var removeButton = $('.modal-footer .btn-red', '#deleteModal');
// if ($(this).val() == title) { if ($(this).val() == title) {
// removeButton.removeAttr('disabled'); removeButton.removeAttr('disabled');
// switch (type) { switch (type) {
// case "Blog-Post": case "Blog-Post":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")'); removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/blog/deleteFinally", "post")');
// break; break;
// case "Projekt": case "Projekt":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")'); removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete", "entry")');
// break; break;
// case "Projekt-Kategorie": case "Projekt-Kategorie":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")'); removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/projects/delete_category", "category")');
// break; break;
// case "Datei": case "Datei":
// removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")'); removeButton.attr('onclick', 'deletePostFinally(' + id + ', "/admin/files/delete", "file")');
// break; break;
// } }
// removeButton.css('cursor', 'pointer'); removeButton.css('cursor', 'pointer');
// } else { } else {
// removeButton.attr('disabled', ''); removeButton.attr('disabled', '');
// removeButton.removeAttr('onclick'); removeButton.removeAttr('onclick');
// removeButton.css('cursor', 'auto'); removeButton.css('cursor', 'auto');
// } }
// }); });
// }); });
function deletePostFinally(id, url, selector) { function deletePostFinally(id, url, selector) {
var row = $("#" + selector + "-" + id); var row = $("#" + selector + "-" + id);