diff options
| author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 20:33:28 +0000 | 
|---|---|---|
| committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-22 20:33:28 +0000 | 
| commit | 8423cda014c6aee9fb3a3f7ebe78bc0465e7355f (patch) | |
| tree | e1baa523308221d33908e4ea4014191ade8d5d66 /mod/pages/javascript/jquery.treeview.async.js | |
| parent | cec8a4f34681d4c2a43e0c07de0a68bc22f1b558 (diff) | |
| download | elgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.gz elgg-8423cda014c6aee9fb3a3f7ebe78bc0465e7355f.tar.bz2  | |
finished the first pass on the pages plugin for using the new HTML/CSS
git-svn-id: http://code.elgg.org/elgg/trunk@7904 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/javascript/jquery.treeview.async.js')
| -rw-r--r-- | mod/pages/javascript/jquery.treeview.async.js | 72 | 
1 files changed, 0 insertions, 72 deletions
diff --git a/mod/pages/javascript/jquery.treeview.async.js b/mod/pages/javascript/jquery.treeview.async.js deleted file mode 100644 index e37f98ee9..000000000 --- a/mod/pages/javascript/jquery.treeview.async.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Async Treeview 0.1 - Lazy-loading extension for Treeview - *  - * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ - * - * Copyright (c) 2007 Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - *   http://www.opensource.org/licenses/mit-license.php - *   http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id$ - * - */ - -;(function($) { - -function load(settings, root, child, container) { -	$.getJSON(settings.url, {root: root, currentpage: settings.currentpage}, function(response) { -		function createNode(parent) { -			var current = $("<li/>").attr("id", this.id || "").html("<span>" + this.text + "</span>").appendTo(parent); -			if (this.classes) { -				current.children("span").addClass(this.classes); -			} -			if (this.expanded) { -				current.addClass("open"); -			} -			if (this.hasChildren || this.children && this.children.length) { -				var branch = $("<ul/>").appendTo(current); -				if (this.hasChildren) { -					current.addClass("hasChildren"); -					createNode.call({ -						text:"placeholder", -						id:"placeholder", -						children:[] -					}, branch); -				} -				if (this.children && this.children.length) { -					$.each(this.children, createNode, [branch]) -				} -			} -		} -		$.each(response, createNode, [child]); -        $(container).treeview({add: child}, root); -    }); -} - -var proxied = $.fn.treeview; -$.fn.treeview = function(settings, source) { -	if (!settings.url) { -		return proxied.apply(this, arguments); -	} -	var container = this; -	load(settings, source, this, container); -	var userToggle = settings.toggle; -	return proxied.call(this, $.extend({}, settings, { -		collapsed: true, -		toggle: function() { -			var $this = $(this); -			if ($this.hasClass("hasChildren")) { -				var childList = $this.removeClass("hasChildren").find("ul"); -				childList.empty(); -				load(settings, this.id, childList, container); -			} -			if (userToggle) { -				userToggle.apply(this, arguments); -			} -		} -	})); -}; - -})(jQuery);
\ No newline at end of file  | 
