Skip to content

Commit

Permalink
Merge pull request #165 from mistercrunch/window_resize
Browse files Browse the repository at this point in the history
Fixing window resize for explore and standalone
  • Loading branch information
mistercrunch committed Mar 4, 2016
2 parents 1782d8f + 9de19b1 commit e39f7db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions panoramix/assets/javascripts/explore.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,5 @@ $(document).ready(function () {
});

$('div.toggle').addClass('pull-right');
slice.bindResizeToWindowResize();
});
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;
},
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();
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.bindResizeToWindowResize();
});

0 comments on commit e39f7db

Please sign in to comment.