2015-04-28 17:10:40 +02:00
|
|
|
$(document).ready( function () {
|
2015-05-14 17:29:01 +02:00
|
|
|
$("#datepicker").datepicker();
|
|
|
|
|
2015-05-15 16:26:50 +02:00
|
|
|
$(".confirm-export").confirm({
|
2015-05-14 17:29:01 +02:00
|
|
|
"text": "Mark current batch exported?",
|
2015-11-11 18:28:07 +01:00
|
|
|
"title": "Export confirmation",
|
|
|
|
"confirm": function(form) {
|
|
|
|
form.submit();
|
2015-05-14 17:29:01 +02:00
|
|
|
},
|
|
|
|
});
|
2015-11-11 18:28:07 +01:00
|
|
|
|
2015-05-16 21:48:42 +02:00
|
|
|
if( $('.addedLink').length > 0) {
|
|
|
|
setTimeout(function (){
|
|
|
|
window.close();
|
|
|
|
}, 500);
|
|
|
|
}
|
2015-11-11 18:28:07 +01:00
|
|
|
|
2015-05-16 23:29:31 +02:00
|
|
|
$("form.form-add").submit( function(e) {
|
|
|
|
if ( $(".add-category").val() == -1) {
|
|
|
|
e.preventDefault();
|
|
|
|
$(".add-category-col").addClass("has-error");
|
|
|
|
}
|
|
|
|
});
|
2015-11-11 18:28:07 +01:00
|
|
|
|
2015-06-07 18:34:14 +02:00
|
|
|
$(".category-change-parent").change(function (e) {
|
2015-06-21 20:42:05 +02:00
|
|
|
e.target.parentElement.submit();
|
2015-06-07 18:34:14 +02:00
|
|
|
});
|
2015-11-11 18:28:07 +01:00
|
|
|
|
2015-07-09 06:44:55 +02:00
|
|
|
$('.cat-delete').confirm({
|
|
|
|
text: "Are you sure you want to delete this category?",
|
2015-11-20 05:00:33 +01:00
|
|
|
title: "Delete confrimation",
|
|
|
|
confirm: function(form) {
|
|
|
|
console.log("fooo");
|
|
|
|
form.submit();
|
|
|
|
}
|
2015-09-03 16:16:16 +02:00
|
|
|
});
|
2015-11-11 18:28:07 +01:00
|
|
|
|
|
|
|
$(".confirm-news-delete").confirm({
|
2015-09-03 16:16:16 +02:00
|
|
|
"text": "Delete news item?",
|
|
|
|
"title": "Delete confirmation",
|
2015-11-20 05:00:33 +01:00
|
|
|
confirm: function(form) {
|
2015-11-11 18:28:07 +01:00
|
|
|
form.submit();
|
|
|
|
}
|
2015-07-09 06:44:55 +02:00
|
|
|
});
|
2016-01-09 17:32:39 +01:00
|
|
|
|
|
|
|
$(".content-slider").click(function (e) {
|
|
|
|
var contentDiv = $(this).parents('.news-row').find('.post-content');
|
|
|
|
if (contentDiv.hasClass("state-up")) {
|
2016-01-09 18:04:31 +01:00
|
|
|
contentDiv.removeClass('state-up').addClass('state-down').animate({'max-height': '100%', 'height': '100%'});
|
2016-01-09 17:32:39 +01:00
|
|
|
$(this).html('^');
|
|
|
|
} else {
|
|
|
|
contentDiv.removeClass('state-down').addClass('state-up').animate({height: '5em'});
|
|
|
|
$(this).html('v');
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
2015-04-28 17:10:40 +02:00
|
|
|
});
|