forked from creativecommons/creativecommons.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlegalcode.js
28 lines (23 loc) · 806 Bytes
/
legalcode.js
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
(function ($) {
$(function() {
// Make .usage-considerations collapsibles
$('.usage-considerations').each(function() {
var $trigger = $('<a href="#" class="cc-collapsible__trigger"><span><img src="/images/deed/svg/deed_arrow_orange.svg" /></span></a>');
$trigger.click(function() {
$(this).parent().toggleClass('collapsed');
return false;
});
$(this)
.addClass('cc-collapsible collapsed')
.append($trigger);
});
// Language selector
$('#language-selector-block select').change(function(e) {
var destination = $(e.target).val();
var deedPath = window.location.pathname.split('/');
deedPath.pop();
deedPath.push(destination);
window.location.href = deedPath.join('/');
});
});
}(jQuery));