Final for now
This commit is contained in:
parent
28b5be76c5
commit
801a5b63df
53 changed files with 2047 additions and 621 deletions
|
|
@ -1,4 +1,4 @@
|
|||
$(document).ready(function () {
|
||||
function setupClicker() {
|
||||
// when hovering over arrow, add highlight (only if inactive)
|
||||
$("i.methodToggle").hover(function () {
|
||||
if (!$("i.methodToggle").hasClass('active'))
|
||||
|
|
@ -9,9 +9,20 @@ $(document).ready(function () {
|
|||
}
|
||||
);
|
||||
|
||||
// after expanding the hidden description, hide the ellipsis
|
||||
$("i.methodToggle").click(function() {
|
||||
var $article = $(this).closest('.article'),
|
||||
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) {
|
||||
|
|
@ -19,36 +30,37 @@ $(document).ready(function () {
|
|||
$arrow.removeClass('inactive').addClass('active');
|
||||
|
||||
var data = $arrow[0].id.replace(/^js_/, "");
|
||||
location.hash = data + "#nav=api";
|
||||
//var state = {};
|
||||
//state.section = data;
|
||||
//$.bbq.pushState(state);
|
||||
|
||||
scrollTo(null, data);
|
||||
}
|
||||
else {
|
||||
$article.removeClass('methodToggleOpen');
|
||||
$arrow.removeClass('active').addClass('inactive');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.signature-call, .signature-returns', '.signature').click(function() {
|
||||
var $article = $(this).closest('.article'),
|
||||
$arrow = $('i.methodClicker', $article);
|
||||
|
||||
if (!$article.hasClass('methodToggleOpen') || this.force) {
|
||||
$article.addClass('methodToggleOpen');
|
||||
$arrow.removeClass('inactive').addClass('active');
|
||||
|
||||
var data = $arrow[0].id.replace(/^js_/, "");
|
||||
location.hash = data + "#nav=api";
|
||||
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