Fixing window resize for explore and standalone

This commit is contained in:
Maxime Beauchemin 2016-03-04 14:19:33 -05:00
parent 1782d8f278
commit 722c16a6e5
3 changed files with 12 additions and 0 deletions

View File

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

View File

@ -217,6 +217,15 @@ var px = (function () {
others += widget.find('.slice_header').height();
return widget.height() - others;
},
setResizeOnWindowResize: 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.setResizeOnWindowResize();
});