If explorer nav menu is empty, take user directly to the explorer view

pull/1835/head
Matt Westcott 2015-10-15 22:04:09 +01:00
rodzic c0f390a9c2
commit f63986f47d
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -18,6 +18,15 @@ $(function() {
$explorer.load($this.data('explorer-menu-url'), function() {
$this.removeClass('icon-spinner');
if ($explorer.find('.dl-menu li').length === 0) {
/*
AJAX fetch returned an empty dl-menu UL, i.e. no pages exist whatsoever.
Take the user directly to the page explorer view, since we aren't giving
them anything to click on to get there...
*/
document.location.href = $this.attr('href');
}
$explorer.addClass('dl-menuwrapper').dlmenu({
animationClasses: {
classin: 'dl-animate-in-2',