From: ojan@chromium.org Date: Tue, 4 Jan 2011 21:52:49 +0000 (+0000) Subject: 2010-12-15 Ojan Vafai X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=b6b9c39dff6575cc0170f742b7616ca03b37e4f9 2010-12-15 Ojan Vafai Reviewed by Adam Barth. anchor the toolbar to the bottom of the diff if the diff doesn't take a full screen of height https://bugs.webkit.org/show_bug.cgi?id=51162 * PrettyPatch/PrettyPatch.rb: * code-review.js: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75003 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog index 630a46e8a7cc..2fe3d51bf8fc 100644 --- a/Websites/bugs.webkit.org/ChangeLog +++ b/Websites/bugs.webkit.org/ChangeLog @@ -1,3 +1,13 @@ +2010-12-15 Ojan Vafai + + Reviewed by Adam Barth. + + anchor the toolbar to the bottom of the diff if the diff doesn't take a full screen of height + https://bugs.webkit.org/show_bug.cgi?id=51162 + + * PrettyPatch/PrettyPatch.rb: + * code-review.js: + 2011-01-01 Adam Barth Reviewed by Eric Seidel. diff --git a/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb b/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb index d0ee144ce4bf..ea55f0b19f54 100644 --- a/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb +++ b/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb @@ -114,7 +114,7 @@ private background-color: #f8f8f8; border: 1px solid #ddd; font-family: monospace; - margin: 2em 0px; + margin: 1em 0; } h1 { @@ -230,16 +230,19 @@ body { #toolbar { display: -webkit-box; display: -moz-box; - position: fixed; padding: 3px; bottom: 0; left: 0; right: 0; - border-top: 1px solid #ddd; + border: 1px solid #ddd; background-color: #eee; font-family: sans-serif; } +#toolbar.anchored { + position: fixed; +} + #toolbar .actions { float: right; } @@ -350,6 +353,13 @@ body { border: none; vertical-align: middle; } + +.pseudo_resize_event_iframe { + height: 10%; + width: 10%; + position: absolute; + top: -11%; +} diff --git a/Websites/bugs.webkit.org/code-review.js b/Websites/bugs.webkit.org/code-review.js index 2a3b2c96c717..daa99e78710b 100644 --- a/Websites/bugs.webkit.org/code-review.js +++ b/Websites/bugs.webkit.org/code-review.js @@ -602,11 +602,20 @@ $('#statusBubbleContainer').addClass('wrap'); } + function onBodyResize() { + updateToolbarAnchorState(); + } + + function updateToolbarAnchorState() { + var has_scrollbar = window.innerWidth > document.documentElement.offsetWidth; + $('#toolbar').toggleClass('anchored', has_scrollbar); + } + $(document).ready(function() { crawlDiff(); fetchHistory(); $(document.body).prepend('
Select line numbers to add a comment.
'); - $(document.body).prepend('
' + + $(document.body).append('
' + '
' + '' + '
' + @@ -624,6 +633,14 @@ $('.overallComments textarea').bind('click', openOverallComments); $(document.body).prepend('
'); + + // Create a dummy iframe and monitor resizes in it's contentWindow to detect when the top document's body changes size. + // FIXME: Should we setTimeout throttle these? + var resize_iframe = $(''); + $(document.body).append(resize_iframe); + $(resize_iframe[0].contentWindow).bind('resize', onBodyResize); + + updateToolbarAnchorState(); }); function discardComment() {