Skip to content

Instantly share code, notes, and snippets.

@JetFault
Created August 16, 2012 18:29
Show Gist options
  • Save JetFault/3372418 to your computer and use it in GitHub Desktop.
Save JetFault/3372418 to your computer and use it in GitHub Desktop.
Github Fit Screen
var main = function () {
var ghresize = function (options) {
var ghwid = $("div#wrapper").width()
, extra = $("span.repo-label").width() * 2;
if(options && options.debug) {
console.log("Resizing");
}
$("div.container.hentry").width(ghwid - extra);
$("div.frame.frame-center").width(ghwid - extra);
var old_frame = $("div.frame:not(div.frame.frame-center):not(div.frame.frame-loading)");
if(old_frame.css("margin-left") == "0px") {
old_frame.css("margin-left", 0);
} else {
old_frame.css("margin-left", -ghwid);
}
};
$("#slider").bind("slid", function() {
setTimeout(function() { ghresize(); }, 250);
});
$(window).ready(function () {
ghresize();
});
$(window).resize(function() {
ghresize();
});
};
@JetFault
Copy link
Author

GreaseMonkey, Chrome Extension, Bookmarklet: http://userscripts.org/scripts/show/141070

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment