Permalink
Browse files

Merge pull request #551 from remy/feature/splitter-size

Show the size of the output window for you repsonsive lovers. Fixes #530
  • Loading branch information...
2 parents efd8104 + 41ef614 commit 6d7485ec5a2932acaa9409011948f0552b483186 @remy remy committed Mar 28, 2013
Showing with 13 additions and 0 deletions.
  1. +12 −0 public/js/render/live.js
  2. +1 −0 views/index.html
View
@@ -167,6 +167,18 @@ function renderLivePreview(withalerts) {
liveScrollTop = this.scrollY;
};
+ var size = $live.find('.size'),
+ timer = null;
+
+ var hide = throttle(function () {
+ size.fadeOut(200);
+ }, 2000);
+ $(win).on('resize', function () {
+ // clearTimeout(timer);
+ size.show().html(this.innerWidth + 'px');
+ hide();
+ });
+
win.resizeJSBin = throttle(function () {
var height = ($body.outerHeight(true) - $frame.height()) + doc.documentElement.offsetHeight;
window.parent.postMessage({ height: height }, '*');
View
@@ -263,6 +263,7 @@
<label>Auto-run JS<input type="checkbox" id="enablejs"></label>
<a target="_blank" title="Live preview" id="jsbinurl" class="{{^code_id}}hidden{{/code_id}}" href="{{code_id_path}}"><img src="{{static}}/images/popout.png"></a>
</span>
+ <span class="size"></span>
</div>
</div>
</div>

0 comments on commit 6d7485e

Please sign in to comment.