Replace deprecated Knockout throttle with new debounce extender

Replace admin general mainAttachmentLimit with input type="number"
This commit is contained in:
djmaze 2021-02-10 12:12:36 +01:00
parent 75b7176ada
commit 8c780ad353
18 changed files with 45 additions and 84 deletions

View file

@ -1,7 +1,6 @@
import 'External/ko';
import ko from 'ko';
import { SaveSettingsStep } from 'Common/Enums';
import { pInt } from 'Common/Utils';
ko.bindingHandlers.saveTrigger = {
init: (element) => {
@ -38,27 +37,6 @@ ko.extenders.idleTrigger = (target) => {
return target;
};
ko.extenders.posInterer = (target, defaultVal) => {
const result = ko.computed({
read: target,
write: newValue => {
let val = pInt(newValue.toString(), defaultVal);
if (0 >= val) {
val = defaultVal;
}
if (val === target() && '' + val !== '' + newValue) {
target(val + 1);
}
target(val);
}
});
result(target());
return result;
};
// functions
ko.observable.fn.idleTrigger = function() {