Skip to content

Instantly share code, notes, and snippets.

@vinaydotblog
Forked from ryanb/github_tree_slider.js
Created October 20, 2012 07:14
Show Gist options
  • Select an option

  • Save vinaydotblog/3922474 to your computer and use it in GitHub Desktop.

Select an option

Save vinaydotblog/3922474 to your computer and use it in GitHub Desktop.

Revisions

  1. @ryanb ryanb created this gist Dec 6, 2010.
    28 changes: 28 additions & 0 deletions github_tree_slider.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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)
    }
    }
    };