public
Last active

This is how GitHub's new AJAX file browser works.

  • Download Gist
github_tree_slider.js
JavaScript
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
GitHub.TreeSlider = function () {
if (window.history && window.history.pushState) {
function a() {
if (e.sliding) {
e.sliding = false;
$(".frame-right").hide();
$(".frame-loading:visible").removeClass("frame-loading")
}
}
if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
window.history.replaceState({
path: this.pathFromURL(location.pathname)
}, "");
var e = this;
$(".frames a.js-slide-to, .breadcrumb a").live("click", function (b) {
if (b.which == 2 || b.metaKey || b.ctrlKey) return true;
else {
e.clickHandler(b);
return false
}
});
$(window).bind("popstate", function (b) {
e.popStateHandler(b.originalEvent)
});
$(".frames .frame").live("webkitTransitionEnd", a).live("transitionend", a)
}
}
};

Is GitHubs slider free for reuse on my own site?

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.