Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Show the size of the output window for you repsonsive lovers. Fixes #530 #551

Merged
merged 1 commit into from

1 participant

@remy
Owner

No description provided.

@remy remy merged commit 6d7485e into master
@remy remy deleted the feature/splitter-size branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 0 deletions.
  1. +12 −0 public/js/render/live.js
  2. +1 −0  views/index.html
View
12 public/js/render/live.js
@@ -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
1  views/index.html
@@ -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>
Something went wrong with that request. Please try again.