aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/banners/banners.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/banners/banners.js')
-rw-r--r--app/assets/javascripts/banners/banners.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/banners/banners.js b/app/assets/javascripts/banners/banners.js
new file mode 100644
index 0000000..9fcea06
--- /dev/null
+++ b/app/assets/javascripts/banners/banners.js
@@ -0,0 +1,25 @@
+$(function() {
+ $(document).ready(function() {
+ $(".tree ul:first > li:first").addClass("branch_start");
+ $('.tree ul').find('li:last').addClass("branch_end");
+ $('ul.tristate').tristate();
+
+ $('.tree').delegate('.toggle','click', function(e) {
+ e.preventDefault();
+
+ var $li = $(this).parents('li:first');
+ var $icon = $li.find('.icon.toggle');
+ var $nested = $li.find('.nested');
+
+ if ($icon.hasClass('expanded')) {
+ $icon.removeClass('expanded');
+ $nested.slideUp();
+ }
+ else {
+ $icon.addClass('expanded');
+ $nested.slideDown();
+ }
+
+ });
+ });
+});