mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
cleanup ko.js unused functions
This commit is contained in:
parent
63af2e25ed
commit
53451a1236
43
dev/External/ko.js
vendored
43
dev/External/ko.js
vendored
|
@ -243,16 +243,6 @@ ko.bindingHandlers.initDom = {
|
||||||
init: (element, fValueAccessor) => fValueAccessor()(element)
|
init: (element, fValueAccessor) => fValueAccessor()(element)
|
||||||
};
|
};
|
||||||
|
|
||||||
ko.bindingHandlers.appendDom = {
|
|
||||||
update: (element, fValueAccessor) => {
|
|
||||||
$(element)
|
|
||||||
.hide()
|
|
||||||
.empty()
|
|
||||||
.append(ko.unwrap(fValueAccessor()))
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
ko.bindingHandlers.draggable = {
|
ko.bindingHandlers.draggable = {
|
||||||
init: (element, fValueAccessor, fAllBindingsAccessor) => {
|
init: (element, fValueAccessor, fAllBindingsAccessor) => {
|
||||||
const Globals = require('Common/Globals'),
|
const Globals = require('Common/Globals'),
|
||||||
|
@ -685,16 +675,14 @@ ko.extenders.specialThrottle = (target, option) => {
|
||||||
write: (bValue) => {
|
write: (bValue) => {
|
||||||
if (bValue) {
|
if (bValue) {
|
||||||
target.valueForRead(bValue);
|
target.valueForRead(bValue);
|
||||||
|
} else if (target.valueForRead()) {
|
||||||
|
clearTimeout(target.iSpecialThrottleTimeout);
|
||||||
|
target.iSpecialThrottleTimeout = setTimeout(() => {
|
||||||
|
target.valueForRead(false);
|
||||||
|
target.iSpecialThrottleTimeout = 0;
|
||||||
|
}, target.iSpecialThrottleTimeoutValue);
|
||||||
} else {
|
} else {
|
||||||
if (target.valueForRead()) {
|
target.valueForRead(bValue);
|
||||||
clearTimeout(target.iSpecialThrottleTimeout);
|
|
||||||
target.iSpecialThrottleTimeout = setTimeout(() => {
|
|
||||||
target.valueForRead(false);
|
|
||||||
target.iSpecialThrottleTimeout = 0;
|
|
||||||
}, target.iSpecialThrottleTimeoutValue);
|
|
||||||
} else {
|
|
||||||
target.valueForRead(bValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -714,11 +702,6 @@ ko.observable.fn.idleTrigger = function() {
|
||||||
return this.extend({ 'idleTrigger': true });
|
return this.extend({ 'idleTrigger': true });
|
||||||
};
|
};
|
||||||
|
|
||||||
ko.observable.fn.validateNone = function() {
|
|
||||||
this.hasError = ko.observable(false);
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
ko.observable.fn.validateEmail = function() {
|
ko.observable.fn.validateEmail = function() {
|
||||||
this.hasError = ko.observable(false);
|
this.hasError = ko.observable(false);
|
||||||
|
|
||||||
|
@ -742,16 +725,4 @@ ko.observable.fn.deleteAccessHelper = function() {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
ko.observable.fn.validateFunc = function(fFunc) {
|
|
||||||
this.hasFuncError = ko.observable(false);
|
|
||||||
|
|
||||||
if (isFunction(fFunc)) {
|
|
||||||
this.subscribe(value => this.hasFuncError(!fFunc(value)));
|
|
||||||
|
|
||||||
this.valueHasMutated();
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ko;
|
export default ko;
|
||||||
|
|
Loading…
Reference in a new issue