mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Improved "delete folder" error handling.
This commit is contained in:
parent
503219c70e
commit
1d9c772b94
4 changed files with 42 additions and 36 deletions
14
dev/External/ko.js
vendored
14
dev/External/ko.js
vendored
|
|
@ -3,15 +3,17 @@ import { doc, createElement } from 'Common/Globals';
|
|||
import { SaveSettingsStep } from 'Common/Enums';
|
||||
import { arrayLength, isFunction } from 'Common/Utils';
|
||||
|
||||
const
|
||||
koValue = value => !ko.isObservable(value) && isFunction(value) ? value() : ko.unwrap(value);
|
||||
|
||||
ko.bindingHandlers.tooltipErrorTip = {
|
||||
init: element => {
|
||||
doc.addEventListener('click', () => element.removeAttribute('data-rainloopErrorTip'));
|
||||
init: (element, fValueAccessor) => {
|
||||
doc.addEventListener('click', () => {
|
||||
let value = fValueAccessor();
|
||||
ko.isObservable(value) && value('');
|
||||
element.removeAttribute('data-rainloopErrorTip');
|
||||
});
|
||||
},
|
||||
update: (element, fValueAccessor) => {
|
||||
const value = koValue(fValueAccessor());
|
||||
let value = ko.unwrap(fValueAccessor());
|
||||
value = isFunction(value) ? value() : value;
|
||||
if (value) {
|
||||
setTimeout(() => element.setAttribute('data-rainloopErrorTip', value), 100);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue