|
@@ -166,17 +166,16 @@
|
|
|
$(document).ready(function () {
|
|
|
function gotoTarget(target, pushState) {
|
|
|
$.get('/' + target, function(_data) {
|
|
|
+ $('#reload-icon').removeClass('loading-rotate');
|
|
|
+ if(pushState) {
|
|
|
+ window.top.history.pushState(target, null, '/mc/' + target);
|
|
|
+ }
|
|
|
var received = $(_data);
|
|
|
- // $('#main-sidenav').replaceWith($(_data).find('#main-sidenav'));
|
|
|
- var activeHref = $(_data).find('#main-sidenav').find('.nav-link.active').attr('href');
|
|
|
+ $('#main-content').replaceWith(received.find('#main-content'));
|
|
|
+ var activeHref = received.find('#main-sidenav').find('.nav-link.active').attr('href');
|
|
|
$('#main-sidenav a.nav-link.active').removeClass('active').blur();
|
|
|
$('#main-sidenav a[href="' + activeHref + '"]').addClass('active');
|
|
|
- $('#main-content').replaceWith($(_data).find('#main-content'));
|
|
|
$(window).scrollTop(0);
|
|
|
- if(pushState) {
|
|
|
- window.top.history.pushState(target, null, '/mc/' + target);
|
|
|
- }
|
|
|
- $('#reload-icon').removeClass('loading-rotate');
|
|
|
});
|
|
|
}
|
|
|
$(document).on('click', 'a:not([href="#"]):not([up-modal]):not([up-close]):not([no-ajax]):not([logout])', function() {
|