Bugzilla – Attachment 183119 Details for
Bug 38899
Allow the Vue toolbar to be sticky
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38899: Remove code duplication
Bug-38899-Remove-code-duplication.patch (text/plain), 2.34 KB, created by
Jonathan Druart
on 2025-06-10 09:31:55 UTC
(
hide
)
Description:
Bug 38899: Remove code duplication
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-06-10 09:31:55 UTC
Size:
2.34 KB
patch
obsolete
>From 132eb9d0217f774ea8a2fb140bd6b614a6b58d13 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 May 2025 16:04:30 +0200 >Subject: [PATCH] Bug 38899: Remove code duplication > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 12 ++++++++---- > .../intranet-tmpl/prog/js/vue/components/Toolbar.vue | 11 ++--------- > 2 files changed, 10 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index b660011277a..5c4e2f63159 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -75,17 +75,21 @@ function togglePanel(node) { > } > } > >-$(document).ready(function () { >- //check if sticky element is stuck, if so add floating class >- if ($(".sticky").length) { >+function apply_sticky(nodes) { >+ if (nodes) { > const observer = new IntersectionObserver( > ([e]) => > e.target.classList.toggle("floating", e.intersectionRatio < 1), > { threshold: [1] } > ); > >- observer.observe(document.querySelector(".sticky")); >+ observer.observe(nodes); > } >+} >+ >+$(document).ready(function () { >+ //check if sticky element is stuck, if so add floating class >+ apply_sticky(document.querySelector(".sticky")); > > //check for a hash before setting focus > let hash = window.location.hash; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue >index 3db1eee90b3..1e4d40da7bd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Toolbar.vue >@@ -22,17 +22,10 @@ export default { > observer: null, > }; > }, >- methods: { >- stickyToolbar([e]) { >- e.target.classList.toggle("floating", e.intersectionRatio < 1); >- }, >- }, >+ methods: {}, > mounted() { > if (this.sticky) { >- this.observer = new IntersectionObserver(this.stickyToolbar, { >- threshold: [1], >- }); >- this.observer.observe(this.$refs.toolbar); >+ apply_sticky(this.$refs.toolbar); > } > }, > }; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38899
:
176545
|
176546
|
181822
|
181823
|
181851
|
181852
|
181965
|
182151
|
182249
|
182250
|
182255
|
182449
|
182580
|
182646
|
182973
|
182974
|
182975
|
182976
|
182977
|
182978
|
182979
|
182980
|
183114
|
183115
|
183116
|
183117
|
183118
| 183119 |
183120
|
183121