Fixed issue initially showing expenses for vendor

This commit is contained in:
Hillel Coren 2016-04-10 22:49:48 +03:00
parent 6d5b99551c
commit 1e44929883

View File

@ -174,22 +174,8 @@
window.location = '{{ URL::to('expenses/create/' . $vendor->public_id ) }}'; window.location = '{{ URL::to('expenses/create/' . $vendor->public_id ) }}';
}); });
// load datatable data when tab is shown and remember last tab selected $('.nav-tabs a[href="#expenses"]').tab('show');
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { load_expenses();
var target = $(e.target).attr("href") // activated tab
target = target.substring(1);
localStorage.setItem('vendor_tab', target);
if (!loadedTabs.hasOwnProperty(target)) {
loadedTabs[target] = true;
window['load_' + target]();
}
});
var tab = localStorage.getItem('vendor_tab');
if (tab && tab != 'activity') {
$('.nav-tabs a[href="#' + tab.replace('#', '') + '"]').tab('show');
} else {
//window['load_activity']();
}
}); });
function onArchiveClick() { function onArchiveClick() {