forked from bpiwowar/papercite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpapercite_options.js
33 lines (25 loc) · 1.09 KB
/
papercite_options.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
29
30
31
32
33
(function ($) {
//console.log('papercite_options.js executed!');
// ensure function is not executed outside of the papercite options view
if (location.href.indexOf('papercite') == -1) {
//console.log("Exiting ...!");
return false;
}
$('form h2').eq(1).hide().nextUntil('h2,input').hide();
$('form h2').eq(2).hide().nextUntil('h2,input').hide();
//$('form h2').nextUntil('h2,input').not('.nav-tab-active')
$(document).on('click', '.nav-tab-wrapper a', function () {
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
$(this).addClass('nav-tab-active');
$('form h2').each(function (i, h2) {
$(this).hide();
$(h2).nextUntil('h2,input').hide();
});
// $sectionsToHide = $('section.papercite-section').hide();
// console.log('hide',$sectionsToHide);//.prev('h2').hide();
$('form h2').eq($(this).index()).show();
$('form h2').eq($(this).index()).nextUntil('h2,input').show();
// console.log('show',$sectionsToShow);//.prev('h2').show();
return false;
});
})(jQuery);