mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
resize immediately, except for browser resize event. Fix #111
This commit is contained in:
parent
08a3e8f670
commit
8060842569
@ -392,7 +392,7 @@ const GUI = function(pars) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.__resizeHandler = function() {
|
this.__resizeHandler = function() {
|
||||||
_this.onResize();
|
_this.onResizeDebounced();
|
||||||
};
|
};
|
||||||
|
|
||||||
dom.bind(window, 'resize', this.__resizeHandler);
|
dom.bind(window, 'resize', this.__resizeHandler);
|
||||||
@ -571,7 +571,8 @@ common.extend(
|
|||||||
this.closed = true;
|
this.closed = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
onResize: common.debounce(function() {
|
|
||||||
|
onResize: function() {
|
||||||
// we debounce this function to prevent performance issues when rotating on tablet/mobile
|
// we debounce this function to prevent performance issues when rotating on tablet/mobile
|
||||||
const root = this.getRoot();
|
const root = this.getRoot();
|
||||||
if (root.scrollable) {
|
if (root.scrollable) {
|
||||||
@ -602,7 +603,9 @@ common.extend(
|
|||||||
if (root.__closeButton) {
|
if (root.__closeButton) {
|
||||||
root.__closeButton.style.width = root.width + 'px';
|
root.__closeButton.style.width = root.width + 'px';
|
||||||
}
|
}
|
||||||
}, 200),
|
},
|
||||||
|
|
||||||
|
onResizeDebounced: common.debounce(function() { this.onResize(); }, 200),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark objects for saving. The order of these objects cannot change as
|
* Mark objects for saving. The order of these objects cannot change as
|
||||||
|
Loading…
Reference in New Issue
Block a user