sync from server

This commit is contained in:
2023-05-30 17:34:14 +08:00
parent 98a45a6f19
commit a930a2bf5b
5 changed files with 81 additions and 269 deletions

View File

@ -1,4 +1,4 @@
import { Grid, createElement, createPopup } from "../../ui";
import { Grid, createElement, Popup } from "../../ui";
import { nullOrEmpty, r, contains } from "../../utility";
class Follower {
@ -13,9 +13,10 @@ class Follower {
const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;
const gridContainer = createElement('div', 'follower-grid');
const popup = createPopup(
const popup = new Popup({
onMasking: this.#option.onMasking,
title,
createElement('div', 'follower-wrapper',
content: createElement('div', 'follower-wrapper',
createElement('div', div => div.innerText = r('whoWantReceiveCustomerNotification', 'Who do you want to receive customer notifications?')),
createElement('input', search => {
search.type = 'text';
@ -33,17 +34,19 @@ class Follower {
}),
gridContainer
),
{
text: r('ok', 'OK'),
key: 'ok',
trigger: () => {
if (typeof this.#option.onOk === 'function') {
return this.#option.onOk.call(this, this.#grid.source.filter(f => f.Email || f.Text));
buttons: [
{
text: r('ok', 'OK'),
key: 'ok',
trigger: () => {
if (typeof this.#option.onOk === 'function') {
return this.#option.onOk.call(this, this.#grid.source.filter(f => f.Email || f.Text));
}
}
}
},
{ text: r('cancel', 'Cancel'), key: 'cancel' }
);
},
{ text: r('cancel', 'Cancel'), key: 'cancel' }
]
});
const result = await popup.show(parent);
result.querySelector('.follower-search').focus();
// grid