mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Move some knockoutjs bindings, extenders and functions to Admin and User specific areas
This commit is contained in:
parent
95e88af017
commit
9c18126843
8 changed files with 368 additions and 344 deletions
|
|
@ -45,6 +45,12 @@ import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
|||
|
||||
const Settings = rl.settings;
|
||||
|
||||
ko.extenders.toggleSubscribe = (target, options) => {
|
||||
target.subscribe(options[1], options[0], 'beforeChange');
|
||||
target.subscribe(options[2], options[0]);
|
||||
return target;
|
||||
};
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Compose',
|
||||
templateID: 'PopupsCompose'
|
||||
|
|
|
|||
|
|
@ -10,6 +10,15 @@ import Remote from 'Remote/User/Fetch';
|
|||
import { popup, command } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
ko.observable.fn.validateEmail = function() {
|
||||
this.hasError = ko.observable(false);
|
||||
|
||||
this.subscribe(value => this.hasError(value && !/^[^@\s]+@[^@\s]+$/.test(value)));
|
||||
|
||||
this.valueHasMutated();
|
||||
return this;
|
||||
};
|
||||
|
||||
@popup({
|
||||
name: 'View/Popup/Identity',
|
||||
templateID: 'PopupsIdentity'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue