Files
sx-fc/app/assets/javascripts/custom.js
2017-10-20 18:50:30 +06:30

51 lines
1.2 KiB
JavaScript

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