Add ajax reload to org home
This commit is contained in:
parent
392a39c43e
commit
e35f91ca2d
5 changed files with 32 additions and 22 deletions
|
@ -97,6 +97,7 @@
|
|||
$(function () {
|
||||
$('img.unveil').unveil(200);
|
||||
});
|
||||
const loading_page = `{% include "loading-page.html" %}`;
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,5 +14,10 @@
|
|||
$(this).parent().submit();
|
||||
}
|
||||
});
|
||||
|
||||
$('#control-panel a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
navigateTo($(this));
|
||||
})
|
||||
});
|
||||
</script>
|
|
@ -129,18 +129,13 @@
|
|||
})
|
||||
$('#logout').on('click', () => $('#logout-form').submit());
|
||||
}
|
||||
$(function () {
|
||||
const loading_page = `{% include "loading-page.html" %}`;
|
||||
window.addEventListener('popstate', (e) => {
|
||||
window.location.href = e.currentTarget.location.href;
|
||||
});
|
||||
|
||||
$('.left-sidebar-item').on('click', function() {
|
||||
var url = $(this).attr('data-href');
|
||||
function navigateTo($elem) {
|
||||
var url = $elem.attr('data-href') || $elem.attr('href');
|
||||
|
||||
if (url === '#') return;
|
||||
$('.left-sidebar-item').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
$elem.addClass('active');
|
||||
$('.middle-right-content').html(loading_page);
|
||||
$.get(url, function(data) {
|
||||
var reload_content = $(data).find('.middle-right-content');
|
||||
|
@ -155,6 +150,15 @@
|
|||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
window.addEventListener('popstate', (e) => {
|
||||
window.location.href = e.currentTarget.location.href;
|
||||
});
|
||||
|
||||
$('.left-sidebar-item').on('click', function() {
|
||||
navigateTo($(this));
|
||||
});
|
||||
$('.blog-box').on('click', function() {
|
||||
var $description = $(this).children('.blog-description');
|
||||
|
|
Loading…
Reference in a new issue