mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Update built files with debounce fix
This commit is contained in:
parent
743794f483
commit
794427af09
@ -1964,6 +1964,24 @@ dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, contro
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GUI.debounce = function (func, threshold) {
|
||||||
|
var timeout;
|
||||||
|
|
||||||
|
return function debounced () {
|
||||||
|
var obj = this, args = arguments;
|
||||||
|
function delayed () {
|
||||||
|
func.apply(obj, args);
|
||||||
|
timeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout = setTimeout(delayed, threshold);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
GUI.CLASS_AUTO_PLACE = 'a';
|
GUI.CLASS_AUTO_PLACE = 'a';
|
||||||
GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';
|
GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';
|
||||||
GUI.CLASS_MAIN = 'main';
|
GUI.CLASS_MAIN = 'main';
|
||||||
@ -2109,7 +2127,7 @@ dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, contro
|
|||||||
this.closed = true;
|
this.closed = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
onResize: function() {
|
onResize: GUI.debounce(function() {
|
||||||
|
|
||||||
var root = this.getRoot();
|
var root = this.getRoot();
|
||||||
|
|
||||||
@ -2143,7 +2161,7 @@ dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, contro
|
|||||||
root.__closeButton.style.width = root.width + 'px';
|
root.__closeButton.style.width = root.width + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
}, 1000),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark objects for saving. The order of these objects cannot change as
|
* Mark objects for saving. The order of these objects cannot change as
|
||||||
|
90
build/dat.gui.min.js
vendored
90
build/dat.gui.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user