aboutsummaryrefslogtreecommitdiff
path: root/assets/js/ps-app.js
blob: 2007469d7429e654a20510f5d77c00afe33e7fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(function($) {

    $(document).ready(function() {

	// Make each .media section clickable to reach ./<id>/
	$('.media section').each(function(_, e) {
	    e.onclick = function(e) {
		var id = false
		e.path.forEach(function(e) {
		    if (e.id) id = e.id
		    if (id !== false) return id
		})
		if (id !== false)
		    window.location = './' + id + '/'
		return false
	    }
	})

    });

})($)