Fixed the router, and editable div
This commit is contained in:
39
resources/js/router/index.js
vendored
39
resources/js/router/index.js
vendored
@@ -47,7 +47,7 @@ async function getMatchedComponents (to) {
|
||||
*/
|
||||
async function beforeEach (to, from, next) {
|
||||
// Sentry tracking
|
||||
if (window.config.sentry_dsn) {
|
||||
if (false && window.config.sentry_dsn) {
|
||||
Sentry.configureScope((scope) => scope.setTransactionName(to?.name || 'Unknown route name'))
|
||||
}
|
||||
|
||||
@@ -163,18 +163,6 @@ function parseMiddleware (middleware) {
|
||||
return { middleware: name, params }
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve async components.
|
||||
*
|
||||
* @param {Array} components
|
||||
* @return {Array}
|
||||
*/
|
||||
function resolveComponents (components) {
|
||||
return Promise.all(components.map(component => {
|
||||
return typeof component === 'function' ? component() : component
|
||||
}))
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the the global middleware with the components middleware.
|
||||
*
|
||||
@@ -222,18 +210,7 @@ function scrollBehavior (to, from, savedPosition) {
|
||||
if (to.hash) {
|
||||
return { selector: to.hash }
|
||||
}
|
||||
|
||||
const [component] = getMatchedComponents(to)
|
||||
|
||||
if (component && component.scrollToTop === false) {
|
||||
return {}
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
resolve({ left: 0, top: 0 })
|
||||
}, 190)
|
||||
})
|
||||
return {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,3 +227,15 @@ function resolveMiddleware (requireContext) {
|
||||
})
|
||||
return middlewares
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve async components.
|
||||
*
|
||||
* @param {Array} components
|
||||
* @return {Array}
|
||||
*/
|
||||
function resolveComponents (components) {
|
||||
return Promise.all(components.map(component => {
|
||||
return typeof component === 'function' ? component() : component
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user