mirror of
https://github.com/a2nt/meta-lightbox.git
synced 2024-10-22 17:05:53 +02:00
IMPR: Events handling
This commit is contained in:
parent
3ee3c9850f
commit
d025910921
@ -1,6 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Lightbox window
|
* Lightbox window
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import Events from './_events';
|
||||||
import { Component } from 'react';
|
import { Component } from 'react';
|
||||||
import styles from '../scss/_window.scss';
|
import styles from '../scss/_window.scss';
|
||||||
|
|
||||||
@ -109,6 +111,8 @@ class MetaWindow extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.state.collections[gallery][i].click();
|
ui.state.collections[gallery][i].click();
|
||||||
|
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.next'));
|
||||||
};
|
};
|
||||||
|
|
||||||
prev = () => {
|
prev = () => {
|
||||||
@ -124,6 +128,8 @@ class MetaWindow extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.state.collections[gallery][i].click();
|
ui.state.collections[gallery][i].click();
|
||||||
|
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.prev'));
|
||||||
};
|
};
|
||||||
|
|
||||||
reset = () => {
|
reset = () => {
|
||||||
@ -214,6 +220,8 @@ class MetaWindow extends Component {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.loaded'));
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -239,6 +247,8 @@ class MetaWindow extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.setState({ error: msg });
|
ui.setState({ error: msg });
|
||||||
|
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.error'));
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
ui.setState({ loading: false });
|
ui.setState({ loading: false });
|
||||||
@ -281,6 +291,7 @@ class MetaWindow extends Component {
|
|||||||
console.log(`${ui.name}: show`);
|
console.log(`${ui.name}: show`);
|
||||||
|
|
||||||
ui.setState({ shown: true });
|
ui.setState({ shown: true });
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.show'));
|
||||||
};
|
};
|
||||||
|
|
||||||
hide = () => {
|
hide = () => {
|
||||||
@ -288,6 +299,7 @@ class MetaWindow extends Component {
|
|||||||
|
|
||||||
console.log(`${ui.name}: hide`);
|
console.log(`${ui.name}: hide`);
|
||||||
ui.setState({ shown: false });
|
ui.setState({ shown: false });
|
||||||
|
W.dispatchEvent(new Event('MetaLightboxUI.hide'));
|
||||||
};
|
};
|
||||||
|
|
||||||
getHtml = () => {
|
getHtml = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user