Skip to content

Commit

Permalink
Fixing window resize for explore and standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 4, 2016
1 parent 1782d8f commit 722c16a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions panoramix/assets/javascripts/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,6 @@ $(document).ready(function () {
});

$('div.toggle').addClass('pull-right');
slice.setResizeOnWindowResize();

});
9 changes: 9 additions & 0 deletions panoramix/assets/javascripts/modules/panoramix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions panoramix/assets/javascripts/standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ $(document).ready(function () {
var data = $('.slice').data('slice');
slice = px.Slice(data);
slice.render();
slice.setResizeOnWindowResize();
});

0 comments on commit 722c16a

Please sign in to comment.