mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-29 19:14:49 +00:00
If explorer nav menu is empty, take user directly to the explorer view
This commit is contained in:
parent
c0f390a9c2
commit
f63986f47d
1 changed files with 9 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue