Reshuffle dirs
This commit is contained in:
parent
e56ab9d4ab
commit
629e543ef4
73 changed files with 105 additions and 2110 deletions
69
doc/template/resources/javascripts/clicker.js
vendored
Normal file
69
doc/template/resources/javascripts/clicker.js
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
function setupClicker() {
|
||||
// when hovering over arrow, add highlight (only if inactive)
|
||||
$("i.methodToggle").hover(function () {
|
||||
if (!$("i.methodToggle").hasClass('active'))
|
||||
$(this).addClass("methodToggleHover");
|
||||
},
|
||||
function () {
|
||||
$(this).removeClass("methodToggleHover");
|
||||
}
|
||||
);
|
||||
|
||||
function handleClick(e, linkHref) {
|
||||
//if (linkHref.indexOf("nav=api&api=") >= 0)
|
||||
// return;
|
||||
if (linkHref == "api")
|
||||
return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var dstElem;
|
||||
if (linkHref) {
|
||||
dstElem = $("article[id='" + linkHref + "']");
|
||||
}
|
||||
|
||||
var $article = (dstElem || $(this)).closest('.article'),
|
||||
$arrow = $('i.methodClicker', $article);
|
||||
|
||||
if (!$article.hasClass('methodToggleOpen') || this.force) {
|
||||
$article.addClass('methodToggleOpen');
|
||||
$arrow.removeClass('inactive').addClass('active');
|
||||
|
||||
if (!$arrow[0])
|
||||
return;
|
||||
|
||||
var data = $arrow[0].id.replace(/^js_/, "");
|
||||
//var state = {};
|
||||
//state.section = data;
|
||||
//$.bbq.pushState(state);
|
||||
|
||||
scrollTo(null, data);
|
||||
}
|
||||
else {
|
||||
$article.removeClass('methodToggleOpen');
|
||||
$arrow.removeClass('active').addClass('inactive');
|
||||
}
|
||||
}
|
||||
|
||||
function transformHash(e) {
|
||||
// some bs to figure out link hash
|
||||
var hashId = (e.srcElement ? e.srcElement.href : (e.hash || e.target.href)) || e.currentTarget.hash;
|
||||
|
||||
handleClick(e, hashId.substring(hashId.indexOf("#") + 1));
|
||||
}
|
||||
|
||||
// for the arrow
|
||||
$("i.methodToggle").click(handleClick);
|
||||
|
||||
// for the signature
|
||||
$('.member-name').click(handleClick);
|
||||
|
||||
// for the top dropdown
|
||||
$('li.memberLink a').click(transformHash);
|
||||
|
||||
//$('a[href^="#"]').click(transformHash);
|
||||
|
||||
$('.related-to', '.metaInfo').click(function(){
|
||||
location.hash = $(this).find('a').attr('href').split('#')[1];
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue