mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue