Skip to content

Commit

Permalink
Document trickiness.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode committed May 2, 2010
1 parent a9fb077 commit 507e741
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bar.html
Expand Up @@ -59,6 +59,14 @@
$('#comments span').text(info.num_comments);

window.setTimeout(function() {
// Note: there's an interesting interaction here: if a size change is necessary, this will lead to
// a resize() event, calling update() again. If the outerWidth/outerHeight haven't changed, a second
// call will presumably have no effect, and not call resize(). However, if the dimensions *have* changed,
// we'll spin around again and again until the outerWidth/outerHeight are unaffected by the size change.
//
// This comes into affect often when the number of lines changes due to wrapping and width change. Thanks
// to the recursive-ish sizing, the height will successfully update if a prior width change caused line
// flow to change.
msgJSON({action:'size', width:$('#bar').outerWidth(), height:$('#bar').outerHeight()});
$('body').width('100%');
}, 10);
Expand Down

0 comments on commit 507e741

Please sign in to comment.