fix scripts
parent
dc5abe1508
commit
ec1e3ff052
@ -1,33 +1,42 @@
|
|||||||
function deletePaper() {
|
/*<![CDATA[*/
|
||||||
$("#remove-paper-modal").modal('show');
|
$(document).ready(function () {
|
||||||
|
$(".paper-row").mouseenter(function (event) {
|
||||||
|
var paperRow = $(event.target).closest(".paper-row");
|
||||||
|
$(paperRow).css("background-color", "#f8f9fa");
|
||||||
|
$(paperRow).find(".remove-paper").removeClass("d-none");
|
||||||
|
|
||||||
$("#modal-btn-yes").on("click", function () {
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
|
$(".paper-row").mouseleave(function (event) {
|
||||||
$("#modal-btn-no").on("click", function () {
|
var paperRow = $(event.target).closest(".paper-row");
|
||||||
$("#remove-paper-modal").modal('hide');
|
$(paperRow).css("background-color", "white");
|
||||||
|
$(paperRow).closest(".paper-row").find(".remove-paper").addClass("d-none");
|
||||||
});
|
});
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showPaperDashboard(dashboardElement) {
|
$('a[data-confirm]').click(function(ev) {
|
||||||
getFromRest(urlPapers, function (paperList) {
|
var href = $(this).attr('href');
|
||||||
paperList.forEach(function (paper, index) {
|
if (!$('#dataConfirmModal').length) {
|
||||||
$(dashboardElement).append("<div class=\"col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card\">" +
|
$('#modalDelete').append('<div class="modal fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"\n' +
|
||||||
"<div class=\"row\">" +
|
' >\n' +
|
||||||
"<div class=\"col-2\">" +
|
' <div class="modal-dialog modal-sm">\n' +
|
||||||
"<span class=\"fa-stack fa-1x\">" +
|
' <div class="modal-content">\n' +
|
||||||
"<i class=\"fa fa-circle fa-stack-2x " + getPaperStatusClass(paper.status) + "\"></i>" +
|
' <div class="modal-header">\n' +
|
||||||
"<i class=\"fa fa-file-text-o fa-stack-1x fa-inverse\"></i>" +
|
' <h8 class="modal-title" id="myModalLabel">Удалить статью?</h8>\n' +
|
||||||
"</span>" +
|
' <button type="button" class="close" data-dismiss="modal" aria-label="Закрыть"><span\n' +
|
||||||
"</div>" +
|
' aria-hidden="true">×</span></button>\n' +
|
||||||
"<div class=\"col col-10 text-right\">" +
|
' </div>\n' +
|
||||||
"<h7 class=\"service-heading\">" + paper.title + "</h7>" +
|
|
||||||
"<p class=\"text-muted\">" + paper.authorsString + "</p>" +
|
' <div class="modal-footer">\n' +
|
||||||
"</div>" +
|
' <a class="btn btn-primary" id="dataConfirmOK">Да</a>'+
|
||||||
"</div>" +
|
' <button class="btn primary" data-dismiss="modal" aria-hidden="true">Нет</button>'+
|
||||||
"</div>");
|
' </div>\n' +
|
||||||
|
' </div>\n' +
|
||||||
|
' </div>\n' +
|
||||||
|
' </div>');
|
||||||
|
}
|
||||||
|
$('#dataConfirmModal').find('#myModalLabel').text($(this).attr('data-confirm'));
|
||||||
|
$('#dataConfirmOK').attr('href', href);
|
||||||
|
$('#dataConfirmModal').modal({show:true});
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
/*]]>*/
|
Loading…
Reference in New Issue