forked from clarketm/TableExport
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
65 lines (46 loc) · 1.44 KB
/
Copy pathmain.js
File metadata and controls
65 lines (46 loc) · 1.44 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
59
60
61
62
63
64
65
$(function () {
var breakHeight = parseFloat($('body').css('line-height').slice(0, -2));
var footerHeight = 0;
$('footer').each(function () {
footerHeight += $(this).outerHeight();
});
$('.navbar-fixed-top').autoHidingNavbar({
hideOffset: 400,
animationDuration: 100
});
$('#side-nav').affix({
offset: {
top: $('main').offset().top,
bottom: (breakHeight * 3) + footerHeight
}
});
$('#side-nav').on('click', 'a', function (e) {
var top = $($(this).attr('href')).offset().top;
$('html, body').animate({scrollTop: top - 80}, 'slow');
return false;
});
$('body').scrollspy({
target: '.scrollspy',
offset: 90
});
var client = $('.btn-clipboard');
new ZeroClipboard(client);
client.on("mouseenter mouseleave", function (e) {
$(this).attr('data-original-title', "Copy to clipboard");
$(this).tooltip('show');
});
client.on("click", function (e) {
$(this).attr('data-original-title', "Copied!");
$(this).tooltip('show');
});
ZeroClipboard.on("copy", function (e) {
var target = e.target;
var text = $(target).nextAll('pre').text();
// alert(text);
e.clipboardData.setData("text/plain", text);
});
var $tables = $('table').slice(1, 3);
$tables.tableExport({
formats: ["xls","csv","txt"],
});
});