var DatatableHtmlTableDemo = function() {
var paginas = function() {
if (document.getElementsByClassName('paginas-table')[0]) {
var datatable = $('.paginas-table').mDatatable({
data: {
saveState: {cookie: false},
},
search: {
input: $('#generalSearch'),
},
columns: [
{
field: "Id",
title: "id",
width: 30,
textAlign: 'center',
},
{
field: "Dominio",
title: "dominio",
width: 300,
},
{
field: "Titulo",
title: "titulo",
width: 100,
},
{
field: "Comportamiento",
title: "comportamiento",
width: 130,
sortable: false,
textAlign: 'center',
overflow: 'visible'
}
],
});
};
}
return {
init: function() {
paginas();
},
};
}();
jQuery(document).ready(function() {
DatatableHtmlTableDemo.init();
options = {
success: showResponse
};
$('#contact-form').ajaxForm(options);
});
function showResponse(response){
if (!response.errors) {
$('#contact-form').html(response.message);
return;
}
$('#contact-form input').removeClass("invalid");
$("#contact-form .error").html('').hide();
$.each(response.errors, function(k, v) {
$('#contact-form #' + k).addClass('invalid');
console.log('#contact-form #' + k);
});
$("#contact-form .error").html(response.message).show();
}
// START: animation from the fixed footer to go to the form
$('.arrow-down').click(function(e){
e.preventDefault();
$('html, body').animate({
scrollTop: $('#contact-form').offset().top
}, 500);
});
// END