mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
improve renderLock events
This commit is contained in:
parent
1666d651d1
commit
0e4ad49ce0
@ -9,7 +9,7 @@ import publicRoutes from "schemas/publicRoutes"
|
||||
|
||||
import Layouts from "layouts"
|
||||
|
||||
export default class Layout extends React.Component {
|
||||
export default class Layout extends React.PureComponent {
|
||||
progressBar = progressBar.configure({ parent: "html", showSpinner: false })
|
||||
|
||||
state = {
|
||||
@ -20,15 +20,37 @@ export default class Layout extends React.Component {
|
||||
|
||||
events = {
|
||||
"app.initialization.start": () => {
|
||||
app.eventBus.emit("layout.render.lock")
|
||||
},
|
||||
"app.initialization.finish": () => {
|
||||
app.eventBus.emit("layout.render.unlock")
|
||||
},
|
||||
"layout.render.lock": () => {
|
||||
this.setState({
|
||||
renderLock: true,
|
||||
})
|
||||
},
|
||||
"app.initialization.finish": () => {
|
||||
"layout.render.unlock": () => {
|
||||
this.setState({
|
||||
renderLock: false,
|
||||
})
|
||||
},
|
||||
"layout.animations.fadeIn": () => {
|
||||
if (app.settings.get("reduceAnimations")) {
|
||||
console.warn("Skipping fadeIn animation due to `reduceAnimations` setting")
|
||||
return false
|
||||
}
|
||||
|
||||
document.querySelector("#transitionLayer").classList.add("fade-opacity-enter")
|
||||
},
|
||||
"layout.animations.fadeOut": () => {
|
||||
if (app.settings.get("reduceAnimations")) {
|
||||
console.warn("Skipping fadeOut animation due to `reduceAnimations` setting")
|
||||
return false
|
||||
}
|
||||
|
||||
document.querySelector("#transitionLayer").classList.add("fade-opacity-leave")
|
||||
},
|
||||
"router.transitionStart": () => {
|
||||
this.progressBar.start()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user