transmet/js/funcs.js

46 lines
1.0 KiB
JavaScript

$(document).ready( function () {
$("#datepicker").datepicker();
$(".confirm-export").confirm({
"text": "Mark current batch exported?",
"title": "Export confirmation",
"confirm": function(form) {
form.submit();
},
});
if( $('.addedLink').length > 0) {
setTimeout(function (){
window.close();
}, 500);
}
$("form.form-add").submit( function(e) {
if ( $(".add-category").val() == -1) {
e.preventDefault();
$(".add-category-col").addClass("has-error");
}
});
$(".category-change-parent").change(function (e) {
e.target.parentElement.submit();
});
$('.cat-delete').confirm({
text: "Are you sure you want to delete this category?",
title: "Delete confrimation",
confirm: function(form) {
console.log("fooo");
form.submit();
}
});
$(".confirm-news-delete").confirm({
"text": "Delete news item?",
"title": "Delete confirmation",
confirm: function(form) {
form.submit();
}
});
});