summaryrefslogtreecommitdiff
path: root/public/static/collapse.js
blob: ba34001bee0aae67212af83c1bdadbb895dd07d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$(document).ready(function() {
	$('div.app > ul > li, div.infoscreen > ul > li').each(function() {
		$(this).click(function() {
			$(this).children('.moreinfo').each(function() {
				if ($(this).hasClass('expanded-moreinfo')) {
					$(this).removeClass('expanded-moreinfo');
					$(this).addClass('collapsed-moreinfo');
				}
				else {
					$('.moreinfo').each(function() {
						if ($(this).hasClass('expanded-moreinfo')) {
							$(this).removeClass('expanded-moreinfo');
							$(this).addClass('collapsed-moreinfo');
						}
					});
					$(this).removeClass('collapsed-moreinfo');
					$(this).addClass('expanded-moreinfo');
				}
			});
		});
	});
	$('.moresettings-header').each(function() {
		$(this).click(function() {
			var moresettings = $('.moresettings');
			if ($(this).hasClass('moresettings-header-collapsed')) {
				$(this).removeClass('moresettings-header-collapsed');
				$(this).addClass('moresettings-header-expanded');
				moresettings.removeClass('moresettings-collapsed');
				moresettings.addClass('moresettings-expanded');
			}
			else {
				$(this).removeClass('moresettings-header-expanded');
				$(this).addClass('moresettings-header-collapsed');
				moresettings.removeClass('moresettings-expanded');
				moresettings.addClass('moresettings-collapsed');
			}
		});
	});
});