Merge pull request #165 from mistercrunch/window_resize

Fixing window resize for explore and standalone
This commit is contained in:
Maxime Beauchemin 2016-03-04 18:57:44 -05:00
commit e39f7db0a3
3 changed files with 11 additions and 0 deletions

View File

@ -330,4 +330,5 @@ $(document).ready(function () {
});
$('div.toggle').addClass('pull-right');
slice.bindResizeToWindowResize();
});

View File

@ -217,6 +217,15 @@ var px = (function () {
others += widget.find('.slice_header').height();
return widget.height() - others;
},
bindResizeToWindowResize: function () {
var resizeTimer;
$(window).on('resize', function (e) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
slice.resize();
}, 500);
});
},
render: function () {
$('.btn-group.results span').attr('disabled', 'disabled');
token.find("img.loading").show();

View File

@ -9,4 +9,5 @@ $(document).ready(function () {
var data = $('.slice').data('slice');
slice = px.Slice(data);
slice.render();
slice.bindResizeToWindowResize();
});