forked from django-cms/django-cms
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lazy loading of the menu on page change list
- Loading branch information
1 parent
d1f5a55
commit e71cd74
Showing
11 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function($) { | ||
$(function() { | ||
admin_base_url = document.URL.split("/cms/page/")[0] + "/"; | ||
$(".tree-default li").click(function(event) { | ||
var target = event.target; | ||
var page_id = $(target).attr("id").split("page_")[1]; | ||
var load_nav_url = admin_base_url + "cms/page/" + page_id + "/load-nav/"; | ||
if($(target).hasClass("closed")) { | ||
if($(target).children('ul').children('li').length == 0) { | ||
$.get(load_nav_url, {}, function(r, status) { | ||
$(target).children('ul').append(r); | ||
}); | ||
} | ||
} | ||
}); | ||
}); | ||
})(jQuery.noConflict()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{% load cms_admin i18n adminmedia %}<li id="page_{{page.pk}}" class="{% if cl.is_filtered %}leaf{% endif %}{% if has_move_page_permission %} moveable{% endif %}{%if page.children.all %} closed{% endif %}"{% if metadata %} mdata="{{ metadata }}{% endif %}" rel="{% ifequal page.level 0 %}topnode{% else %}node{% endifequal %}"> | ||
|
||
{% include 'admin/cms/page/menu_item.html' %} | ||
|
||
{% with page.children as children %} | ||
{% if children %}<ul{% if page.last %} class="last"{% endif %}>{% for child in children.all %} | ||
{# show_lazy_admin_menu child #}{% endfor %} | ||
</ul>{% endif %} | ||
{% endwith %} | ||
</li> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% load cms_admin i18n adminmedia %} | ||
{% with page.children.all as children %} | ||
{% if children %} | ||
{% for child in children %} | ||
{% show_lazy_admin_menu child %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endwith %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters