mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Improved observables
This commit is contained in:
parent
8d7e25fc7c
commit
7db7d5545b
28 changed files with 236 additions and 234 deletions
11
dev/External/User/ko.js
vendored
11
dev/External/User/ko.js
vendored
|
|
@ -287,15 +287,4 @@ ko.extenders.specialThrottle = (target, timeout) => {
|
|||
return target;
|
||||
};
|
||||
|
||||
// functions
|
||||
|
||||
ko.observable.fn.validateEmail = function() {
|
||||
this.hasError = ko.observable(false);
|
||||
|
||||
this.subscribe(value => this.hasError(value && !/^[^@\s]+@[^@\s]+$/.test(value)));
|
||||
|
||||
this.valueHasMutated();
|
||||
return this;
|
||||
};
|
||||
|
||||
export default ko;
|
||||
|
|
|
|||
4
dev/External/ko.js
vendored
4
dev/External/ko.js
vendored
|
|
@ -36,7 +36,6 @@ ko.bindingHandlers.tooltip = {
|
|||
ko.bindingHandlers.tooltipErrorTip = {
|
||||
init: element => {
|
||||
doc.addEventListener('click', () => element.removeAttribute('data-rainloopErrorTip'));
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(element, () => element.removeAttribute('data-rainloopErrorTip'));
|
||||
},
|
||||
update: (element, fValueAccessor) => {
|
||||
const value = koValue(fValueAccessor());
|
||||
|
|
@ -258,8 +257,7 @@ ko.extenders.falseTimeout = (target, option) => {
|
|||
// functions
|
||||
|
||||
ko.observable.fn.deleteAccessHelper = function() {
|
||||
this.extend({ falseTimeout: 3000 }).extend({ toggleSubscribeProperty: [this, 'deleteAccess'] });
|
||||
return this;
|
||||
return this.extend({ falseTimeout: 3000, toggleSubscribeProperty: [this, 'deleteAccess'] });
|
||||
};
|
||||
|
||||
ko.addObservablesTo = (target, observables) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue