2017-08-04 16:28:16 +02:00
|
|
|
$(document).ready(function () {
|
2018-05-14 15:40:17 +02:00
|
|
|
// Inizializzazzione dei box AdminLTE
|
|
|
|
$('.box').boxWidget();
|
|
|
|
|
2017-09-12 16:17:11 +02:00
|
|
|
// Modal di default
|
2017-08-04 16:28:16 +02:00
|
|
|
$('[data-href]').not('.ask, .bound').click(function () {
|
|
|
|
launch_modal($(this).data('title'), $(this).data('href'), 1, $(this).data('target'));
|
|
|
|
});
|
2018-02-28 23:44:30 +01:00
|
|
|
$('[data-href]').not('.ask, .bound').addClass('bound clickable');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2017-09-12 16:17:11 +02:00
|
|
|
// Tooltip
|
2017-09-15 09:48:56 +02:00
|
|
|
$('.tip').not('.tooltipstered').each(function () {
|
|
|
|
$this = $(this);
|
|
|
|
$this.tooltipster({
|
|
|
|
animation: 'grow',
|
|
|
|
contentAsHTML: true,
|
|
|
|
hideOnClick: true,
|
|
|
|
onlyOne: true,
|
|
|
|
maxWidth: 350,
|
|
|
|
touchDevices: true,
|
|
|
|
trigger: 'hover',
|
|
|
|
position: $this.data('position') ? $this.data('position') : 'top',
|
|
|
|
});
|
2017-08-04 16:28:16 +02:00
|
|
|
});
|
|
|
|
|
2017-09-12 16:17:11 +02:00
|
|
|
// Autosize per le textarea
|
2017-08-04 16:28:16 +02:00
|
|
|
autosize($('.autosize'));
|
|
|
|
|
|
|
|
if ($('form').length) {
|
|
|
|
$('form').not('.no-check').parsley();
|
|
|
|
}
|
|
|
|
|
|
|
|
window.Parsley.on('field:success', function () {
|
|
|
|
this.$element.removeClass('parsley-success');
|
|
|
|
});
|
|
|
|
|
2019-07-15 18:34:59 +02:00
|
|
|
start_datepickers();
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2017-08-30 14:43:38 +02:00
|
|
|
// Aggiunta nell'URL del nome tab su cui tornare dopo il submit
|
|
|
|
// Blocco del pulsante di submit dopo il primo submit
|
2017-09-15 09:48:56 +02:00
|
|
|
$("form").submit(function () {
|
2017-08-04 16:28:16 +02:00
|
|
|
if ($(this).parsley().validate()) {
|
2017-09-15 09:48:56 +02:00
|
|
|
$(this).submit(function () {
|
2017-08-04 16:28:16 +02:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
$(this).find('[type=submit]').prop("disabled", true).addClass("disabled");
|
|
|
|
|
2017-08-30 14:43:38 +02:00
|
|
|
$(this).find('input:disabled, select:disabled').prop('disabled', false);
|
|
|
|
|
|
|
|
var hash = window.location.hash;
|
|
|
|
if (hash) {
|
|
|
|
var input = $('<input/>', {
|
|
|
|
type: 'hidden',
|
|
|
|
name: 'hash',
|
|
|
|
value: hash,
|
|
|
|
});
|
|
|
|
|
|
|
|
$(this).append(input);
|
|
|
|
}
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
start_superselect();
|
|
|
|
start_inputmask();
|
|
|
|
});
|