feat: drop jquery debounce for local implementation (#3296)

master
Tomas Chmelevskij 2023-01-31 16:27:38 +01:00 committed by GitHub
parent 4f6fcb0d3b
commit d899009044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 13 deletions

View File

@ -1,9 +0,0 @@
/*
* jQuery throttle / debounce - v1.1 - 3/7/2010
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);

View File

@ -68,6 +68,7 @@
"jquery-touchswipe": "^1.6.19", "jquery-touchswipe": "^1.6.19",
"jquery-ui-npm": "^1.12.0", "jquery-ui-npm": "^1.12.0",
"jsdom": "^21.0.0", "jsdom": "^21.0.0",
"lodash.debounce": "^4.0.8",
"marked": "^4.1.1", "marked": "^4.1.1",
"multicast-dns": "^7.2.5", "multicast-dns": "^7.2.5",
"multiple-select": "^1.5.2", "multiple-select": "^1.5.2",

View File

@ -14,6 +14,7 @@ import semver from "semver";
import jBox from "jbox"; import jBox from "jbox";
import inflection from "inflection"; import inflection from "inflection";
import { checkChromeRuntimeError } from "../utils/common"; import { checkChromeRuntimeError } from "../utils/common";
import debounce from "lodash.debounce";
const FONT = {}; const FONT = {};
const SYM = {}; const SYM = {};
@ -3085,7 +3086,7 @@ osd.initialize = function(callback) {
$(`<input type="number" class="${field.index} position"></input>`) $(`<input type="number" class="${field.index} position"></input>`)
.data('field', field) .data('field', field)
.val(field.position) .val(field.position)
.change($.debounce(250, function() { .change(debounce(function() {
const fieldChanged = $(this).data('field'); const fieldChanged = $(this).data('field');
const position = parseInt($(this).val()); const position = parseInt($(this).val());
fieldChanged.position = position; fieldChanged.position = position;
@ -3093,7 +3094,7 @@ osd.initialize = function(callback) {
.then(function() { .then(function() {
updateOsdView(); updateOsdView();
}); });
})), }, 250)),
); );
} }

View File

@ -62,7 +62,6 @@
<script type="text/javascript" src="./js/libraries/jquery.nouislider.all.min.js"></script> <script type="text/javascript" src="./js/libraries/jquery.nouislider.all.min.js"></script>
<script type="text/javascript" src="./js/libraries/jquery.flightindicators.js"></script> <script type="text/javascript" src="./js/libraries/jquery.flightindicators.js"></script>
<script type="text/javascript" src="./node_modules/bluebird/js/browser/bluebird.min.js"></script> <script type="text/javascript" src="./node_modules/bluebird/js/browser/bluebird.min.js"></script>
<script type="text/javascript" src="./js/libraries/jquery.ba-throttle-debounce.min.js"></script>
<script type="text/javascript" src="./node_modules/jquery-textcomplete/dist/jquery.textcomplete.min.js"></script> <script type="text/javascript" src="./node_modules/jquery-textcomplete/dist/jquery.textcomplete.min.js"></script>
<script type="text/javascript" src="./node_modules/jquery-touchswipe/jquery.touchSwipe.min.js"></script> <script type="text/javascript" src="./node_modules/jquery-touchswipe/jquery.touchSwipe.min.js"></script>
<script type="text/javascript" src="./node_modules/select2/dist/js/select2.min.js"></script> <script type="text/javascript" src="./node_modules/select2/dist/js/select2.min.js"></script>

View File

@ -10314,7 +10314,7 @@ lodash._root@^3.0.0:
lodash.debounce@^4.0.8: lodash.debounce@^4.0.8:
version "4.0.8" version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
lodash.defaults@^4.2.0: lodash.defaults@^4.2.0:
version "4.2.0" version "4.2.0"