mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Fixing the dashboard's look after resizing the window (#556)
This commit is contained in:
parent
52c2b2348a
commit
89f9efd3a3
@ -214,6 +214,7 @@ var Dashboard = function (dashboardData) {
|
||||
this.slices = sliceObjects;
|
||||
this.refreshTimer = null;
|
||||
this.startPeriodicRender(0);
|
||||
this.bindResizeToWindowResize();
|
||||
},
|
||||
setFilter: function (slice_id, col, vals) {
|
||||
this.addFilter(slice_id, col, vals, false);
|
||||
@ -236,6 +237,18 @@ var Dashboard = function (dashboardData) {
|
||||
// Returns a list of human readable active filters
|
||||
return JSON.stringify(this.filters, null, 4);
|
||||
},
|
||||
bindResizeToWindowResize: function () {
|
||||
var resizeTimer;
|
||||
var dash = this;
|
||||
$(window).on('resize', function (e) {
|
||||
clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout(function () {
|
||||
dash.slices.forEach(function (slice) {
|
||||
slice.resize();
|
||||
});
|
||||
}, 500);
|
||||
});
|
||||
},
|
||||
stopPeriodicRender: function () {
|
||||
if (this.refreshTimer) {
|
||||
clearTimeout(this.refreshTimer);
|
||||
|
Loading…
Reference in New Issue
Block a user