54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
|
|
$(document).on('turbolinks:load', function() {
|
|
|
|
$('body').bootstrapMaterialDesign();
|
|
var height = ($(window).height() - ($('.legal').outerHeight() + $('.user-info').outerHeight() + $('.navbar').innerHeight()));
|
|
|
|
$('#custom-slimscroll').slimScroll({
|
|
height: height,
|
|
size: '5px',
|
|
color: 'rgba(0,0,0,0.5)',
|
|
alwaysVisible: false,
|
|
borderRadius: '0',
|
|
railBorderRadius: '0'
|
|
});
|
|
|
|
$('#order-detail-slimscroll').slimScroll({
|
|
height: height-180,
|
|
size: '5px',
|
|
color: 'rgba(0,0,0,0.5)',
|
|
alwaysVisible: false,
|
|
borderRadius: '0',
|
|
railBorderRadius: '0'
|
|
});
|
|
|
|
$('.delete').click(function(){
|
|
var method = $(this).attr('data-method');
|
|
var url = $(this).attr('data-ref');
|
|
var html_text = $( this ).siblings( "#delete_text" ).html();
|
|
console.log(method);
|
|
console.log(url);
|
|
console.log(html_text);
|
|
swal({
|
|
title: "Confirmation",
|
|
text: html_text,
|
|
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");
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|