Skip to content

Commit

Permalink
Merge pull request #8 from Muetze42/development
Browse files Browse the repository at this point in the history
Add fix for scrollbar overflow (Nova 4.5.2)
  • Loading branch information
Muetze42 authored May 12, 2022
2 parents f8157dd + da23dd9 commit 4d88805
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Then the assets are recompiled and published with the Force option.

Attention. The original vendor files will be overwritten.

## Overflow Fix Nova 4.5.2
[resources/Nova/js/layouts/AppLayout.vue](resources/Nova/js/layouts/AppLayout.vue)

## Install
```
composer require norman-huth/nova-assets-changer
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
},
"require": {
"laravel/nova": "^4.3.0"
"laravel/nova": "^4.5.2"
},
"extra": {
"laravel": {
Expand Down
67 changes: 67 additions & 0 deletions resources/Nova/js/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!-- Fixed Navbar Scroll -->
<template>
<div id="nova">
<MainHeader />

<!-- Content -->
<div class="content" data-testid="content">
<div
class="content hidden lg:block lg:absolute left-0 bottom-0 overflow-x-hidden overflow-y-auto lg:top-[56px] w-60 px-3 py-5"
>
<MainMenu />
</div>

<div class="p-4 md:py-8 md:px-12 lg:ml-60">
<FadeTransition>
<slot />
</FadeTransition>

<Footer />
</div>
</div>
</div>
</template>

<script>
import MainHeader from '@/layouts/MainHeader'
import Footer from '@/layouts/Footer'

export default {
components: {
MainHeader,
Footer,
},

mounted() {
Nova.$on('error', this.handleError)
Nova.$on('token-expired', this.handleTokenExpired)
},

beforeUnmount() {
Nova.$off('error', this.handleError)
Nova.$off('token-expired', this.handleTokenExpired)
},

methods: {
handleError(message) {
Nova.error(message)
},

handleTokenExpired() {
// @TODO require Nova._createToast() to support action with link.
Nova.$toasted.show(this.__('Sorry, your session has expired.'), {
action: {
onClick: () => Nova.redirectToLogin(),
text: this.__('Reload'),
},
duration: null,
type: 'error',
})

setTimeout(() => {
Nova.redirectToLogin()
}, 5000)
},
},
}
</script>

0 comments on commit 4d88805

Please sign in to comment.