update confirm box

This commit is contained in:
Aung Myo
2017-10-19 18:17:56 +06:30
parent 034685e1e9
commit 78c6304748
21 changed files with 364 additions and 556 deletions

View File

@@ -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();
});