FIX: ui.flyout .close undefined

This commit is contained in:
Tony Air 2019-12-04 18:19:04 +07:00
parent 26a28191aa
commit 1528e1044e
3 changed files with 22 additions and 19 deletions

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

2
dist/js/app.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -17,27 +17,30 @@ const FlyoutUI = (($) => {
class FlyoutUI {
static init() {
const ui = this;
const $close = ui.$modal.find(`.flyout-${NAME}__close`);
ui.$modal = $(`.flyout-${NAME}`);
if (ui.$modal.length) {
ui.$modal.data(NAME, ui);
if ($close.length) {
$close.on('click', () => {
ui.hide();
});
}
const hide = CookieUI.get(COOKIE);
if (!$close.length || !hide || hide !== 'true') {
setTimeout(() => {
ui.show();
}, TIMEOUT);
}
if (!ui.$modal.length) {
return false;
}
const $close = ui.$modal.find(`.flyout-${NAME}__close`);
ui.$modal.data(NAME, ui);
if ($close.length) {
$close.on('click', () => {
ui.hide();
});
}
const hide = CookieUI.get(COOKIE);
if (!$close.length || !hide || hide !== 'true') {
setTimeout(() => {
ui.show();
}, TIMEOUT);
}
}
static show(callback) {