Update javascript code.

This commit is contained in:
James Cole
2017-01-02 08:30:20 +01:00
parent 3cd0540474
commit 533797fc9e
23 changed files with 24 additions and 110 deletions

View File

@@ -11,6 +11,12 @@
$(function () {
"use strict";
$.ajaxSetup({
headers: {
'X-CSRF-Token': $('meta[name="_token"]').attr('content')
}
});
// when you click on a currency, this happens:
$('.currency-option').click(currencySelect);
@@ -49,18 +55,12 @@ $(function () {
$.post(dateRangeConfig.URL, {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
label: label,
_token: token
label: label
}).done(function () {
console.log('Succesfully sent new date range [' + start.format('YYYY-MM-DD') + '-' + end.format('YYYY-MM-DD') + '].');
window.location.reload(true);
}).fail(function () {
console.log('Could not send new date range.');
alert('Could not change date range');
});
//alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
}
);
@@ -133,7 +133,6 @@ function triggerList(e) {
"use strict";
var link = $(e.target);
var table = link.parent().parent().parent().parent();
console.log('data-hidden = ' + table.attr('data-hidden'));
if (table.attr('data-hidden') === 'no') {
// hide all elements, return false.
table.find('.overListLength').hide();