Prevent the settings throttle from lagging the sliders

This commit is contained in:
Gnome Ann 2022-04-26 21:14:44 -04:00
parent 9cff8268b5
commit b1faca3686
2 changed files with 4 additions and 6 deletions

View File

@ -118,7 +118,7 @@ var adventure = false;
// Chatmode
var chatmode = false;
var sliders_throttle = getThrottle(40);
var sliders_throttle = getThrottle(200);
//=================================================================//
// METHODS
@ -174,12 +174,10 @@ function addSetting(ob) {
window["label_"+ob.id] = reflb; // Is this still needed?
// Add event function to input
var send = function () {
var that = refin;
sliders_throttle(ob.id, function () {
socket.send({'cmd': $(that).attr('id'), 'data': $(that).val()});
refin.val(parseFloat($(that).val()));
reflb.html($(that).val());
socket.send({'cmd': $(refin).attr('id'), 'data': $(refin).val()});
});
reflb.val($(refin).val());
}
refin.on("input", send);
reflb.on("change", function (event) {

View File

@ -17,7 +17,7 @@
<script src="static/bootstrap.min.js"></script>
<script src="static/bootstrap-toggle.min.js"></script>
<script src="static/rangy-core.min.js"></script>
<script src="static/application.js?ver=1.17d"></script>
<script src="static/application.js?ver=1.17e"></script>
</head>
<body>
<input type="file" id="remote-save-select" accept="application/json" style="display:none">