forked from jgthms/bulma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbulma.js
More file actions
58 lines (45 loc) · 1.46 KB
/
bulma.js
File metadata and controls
58 lines (45 loc) · 1.46 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
jQuery(document).ready(function ($) {
var $toggle = $('#nav-toggle');
var $menu = $('#nav-menu');
$toggle.click(function() {
$(this).toggleClass('is-active');
$menu.toggleClass('is-active');
});
$('.modal-button').click(function() {
var target = $(this).data('target');
$('html').addClass('is-clipped');
$(target).addClass('is-active');
});
$('.modal-background, .modal-close').click(function() {
$('html').removeClass('is-clipped');
$(this).parent().removeClass('is-active');
});
$('.modal-card-head .delete, .modal-card-foot .button').click(function() {
$('html').removeClass('is-clipped');
$('#modal-ter').removeClass('is-active');
});
var $highlights = $('.highlight');
$highlights.each(function() {
var $el = $(this);
var copy = '<button class="copy">Copy</button>';
var expand = '<button class="expand">Expand</button>';
$el.append(copy);
if ($el.find('pre code').innerHeight() > 600) {
$el.append(expand);
}
});
var $highlightButtons = $('.highlight .copy, .highlight .expand');
$highlightButtons.hover(function() {
$(this).parent().css('box-shadow', '0 0 0 1px #ed6c63');
}, function() {
$(this).parent().css('box-shadow', 'none');
});
$('.highlight .expand').click(function() {
$(this).parent().children('pre').css('max-height', 'none');
});
new Clipboard('.copy', {
target: function(trigger) {
return trigger.previousSibling;
}
});
});