Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

moved js into change_list.js

  • Loading branch information...
commit 217def34bb0f156fd855f472b29caa7c8b27bbea 1 parent f48d11d
Andrew Schoen authored December 18, 2011
14  cms/static/cms/js/change_list.js
@@ -36,7 +36,7 @@
36 36
 				theme_name: "default",
37 37
 				a_class: "title"
38 38
 			},
39  
-			cookies : MENU_COOKIES,
  39
+			cookies : false,
40 40
 			callback: {
41 41
 				beforemove  : function(what, where, position, tree) {
42 42
 					item_id = what.id.split("page_")[1];
@@ -269,6 +269,18 @@
269 269
 				e.stopPropagation();
270 270
 	            return false;
271 271
 	        }
  272
+
  273
+	        // lazy load descendants on tree open
  274
+	        if(jtarget.hasClass("closed")) {
  275
+	        	// only load them once
  276
+	        	if($(jtarget).find('ul > li').length == 0) {
  277
+                    var pageId = $(jtarget).attr("id").split("page_")[1];
  278
+
  279
+                    $.get(admin_base_url + "cms/page/" + pageId + "/load-nav/", {}, function(r, status) {
  280
+                        $(jtarget).children('ul').append(r);    
  281
+                    });
  282
+                }
  283
+	        }
272 284
 			
273 285
 	        if(jtarget.hasClass("move-target")) {
274 286
 	            if(jtarget.hasClass("left")){
17  cms/static/cms/js/libs/lazyloadmenu.js
... ...
@@ -1,17 +0,0 @@
1  
-(function($) {
2  
-    $(function() {
3  
-        admin_base_url = document.URL.split("/cms/page/")[0] + "/";
4  
-        $(".tree-default li").click(function(event) { 
5  
-            var target = event.target;
6  
-            var page_id = $(target).attr("id").split("page_")[1];
7  
-            var load_nav_url = admin_base_url + "cms/page/" + page_id + "/load-nav/";
8  
-            if($(target).hasClass("closed")) {
9  
-                if($(target).children('ul').children('li').length == 0) {
10  
-                    $.get(load_nav_url, {}, function(r, status) {
11  
-                        $(target).children('ul').append(r);    
12  
-                    });
13  
-                }
14  
-            } 
15  
-        });
16  
-    });
17  
-})(jQuery.noConflict());
8  cms/templates/admin/cms/page/change_list.html
@@ -12,13 +12,6 @@
12 12
 
13 13
 {% block coltype %}flex{% endblock %}
14 14
 {% block extrahead %}
15  
-<script type="text/javascript">
16  
-	{% if CMS_LAZY_LOAD_MENU %}
17  
-	MENU_COOKIES = false;
18  
-	{% else %}
19  
-	MENU_COOKIES = true;
20  
-	{% endif %}
21  
-</script>
22 15
 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cms/css/pages.css"/>
23 16
 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cms/jstree/tree_component.css" />
24 17
 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}cms/css/jquery.dialog.css" />
@@ -41,7 +34,6 @@
41 34
 <script type="text/javascript" src="{{ STATIC_URL }}cms/js/libs/classy.min.js"></script>
42 35
 <script type="text/javascript" src="{{ STATIC_URL }}cms/js/plugins/cms.base.js"></script>
43 36
 <script type="text/javascript" src="{{ STATIC_URL }}cms/js/change_list.js"></script>
44  
-<script type="text/javascript" src="{{ STATIC_URL }}cms/js/libs/lazyloadmenu.js"></script>
45 37
 
46 38
 
47 39
 {% if cl.is_filtered %}

0 notes on commit 217def3

Please sign in to comment.
Something went wrong with that request. Please try again.