update confirm box
This commit is contained in:
@@ -72,34 +72,7 @@ function showConfirmMessage() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$(function(){
|
||||
$('.delete').click(function(){
|
||||
var currentForm = $(this).closest("form");
|
||||
console.log(currentForm);
|
||||
swal({
|
||||
title: "Are you sure?",
|
||||
text: "You will not be able to recover this imaginary file!",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, delete it!",
|
||||
cancelButtonText: "No, cancel plx!",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false
|
||||
}, function (isConfirm) {
|
||||
console.log(isConfirm);
|
||||
if (isConfirm) {
|
||||
console.log("hi")
|
||||
currentForm.submit();
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').bootstrapMaterialDesign();
|
||||
var height = ($(window).height() - ($('.legal').outerHeight() + $('.user-info').outerHeight() + $('.navbar').innerHeight()));
|
||||
@@ -162,10 +135,60 @@ $(function(){
|
||||
'</div>\n',
|
||||
}
|
||||
});
|
||||
|
||||
$('.delete').click(function(){
|
||||
var method = $(this).attr('data-method');
|
||||
var url = $(this).attr('data-ref');
|
||||
var html = $(this).siblings.html();
|
||||
console.log(html);
|
||||
swal({
|
||||
title: "Confirmation",
|
||||
text: $(this).children().children('#delete_text').html(),
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
html: true
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
type: method,
|
||||
url: url ,
|
||||
success: function(data) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.dddddddd').click(function(){
|
||||
var currentForm = $(this).closest("form");
|
||||
bootbox.confirm({
|
||||
title: 'Confirmation',
|
||||
message: $('#delete_text').html(),
|
||||
buttons: {
|
||||
'cancel': {
|
||||
label: 'No',
|
||||
className: 'btn green col-md-4 pull-left'
|
||||
},
|
||||
'confirm': {
|
||||
label: 'Yes',
|
||||
className: 'btn red col-md-4 pull-right'
|
||||
}
|
||||
},
|
||||
callback: function(result) {
|
||||
if (result) {
|
||||
currentForm.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
||||
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
|
||||
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
||||
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
|
||||
$('.dropdown-toggle').dropdown();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user