ultimatepos/public/js/user-profile.js

28 lines
883 B
JavaScript
Vendored

$(document).ready(function() {
$('.up-user-switcher').on('change', function() {
if ($(this).val()) {
window.location = window.USER_PROFILE_BASE_URL + '/' + $(this).val();
}
});
$('a[data-toggle="tab"][href="#documents_tab"]').on('shown.bs.tab', function() {
if (typeof getDocAndNoteIndexPage === 'function') {
getDocAndNoteIndexPage();
}
if (typeof initializeDocumentAndNoteDataTable === 'function') {
setTimeout(function() { initializeDocumentAndNoteDataTable(); }, 200);
}
});
if (window.location.hash) {
var hash = window.location.hash;
$('a[href="' + hash + '"]').tab('show');
}
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
if (e.target.hash) {
history.replaceState(null, '', e.target.hash);
}
});
});