mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-22 05:51:53 +00:00
pass explorer-menu-url as a data attribute on the explorer menu link, so that we don't have to define it as a global in admin_base.html
This commit is contained in:
parent
d6f2b13284
commit
0926c90004
3 changed files with 7 additions and 7 deletions
|
|
@ -29,7 +29,7 @@ $(function(){
|
|||
$this.addClass('icon-spinner');
|
||||
|
||||
if(!$explorer.children().length){
|
||||
$explorer.load(window.explorer_menu_url, function() {
|
||||
$explorer.load($this.data('explorer-menu-url'), function() {
|
||||
$this.removeClass('icon-spinner');
|
||||
|
||||
$explorer.addClass('dl-menuwrapper').dlmenu({
|
||||
|
|
@ -38,10 +38,10 @@ $(function(){
|
|||
classout : 'dl-animate-out-2'
|
||||
}
|
||||
});
|
||||
$explorer.dlmenu('openMenu');
|
||||
$explorer.dlmenu('openMenu');
|
||||
});
|
||||
}else{
|
||||
$explorer.dlmenu('openMenu');
|
||||
$explorer.dlmenu('openMenu');
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -22,9 +22,6 @@
|
|||
<script src="{{ STATIC_URL }}wagtailadmin/js/vendor/bootstrap-tab.js"></script>
|
||||
<script src="{{ STATIC_URL }}wagtailadmin/js/vendor/jquery.dlmenu.js"></script>
|
||||
<script src="{{ STATIC_URL }}wagtailadmin/js/core.js"></script>
|
||||
<script>
|
||||
window.explorer_menu_url = "{% url 'wagtailadmin_explorer_nav' %}";
|
||||
</script>
|
||||
{% endcompress %}
|
||||
|
||||
{% block extra_js %}{% endblock %}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,10 @@ def explorer_subnav(nodes):
|
|||
@register.inclusion_tag('wagtailadmin/shared/main_nav.html', takes_context=True)
|
||||
def main_nav(context):
|
||||
menu_items = [
|
||||
MenuItem(_('Explorer'), urlresolvers.reverse('wagtailadmin_explore_root'), classnames='icon icon-folder-open-inverse dl-trigger', order=100),
|
||||
MenuItem(_('Explorer'), urlresolvers.reverse('wagtailadmin_explore_root'),
|
||||
classnames='icon icon-folder-open-inverse dl-trigger',
|
||||
attrs={'data-explorer-menu-url': urlresolvers.reverse('wagtailadmin_explorer_nav')},
|
||||
order=100),
|
||||
MenuItem(_('Search'), urlresolvers.reverse('wagtailadmin_pages_search'), classnames='icon icon-search', order=200),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue