Bugzilla – Attachment 77164 Details for
Bug 21099
Floating toolbars reposition too late
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21099: Reposition floating toolbars earlier
Bug-21099-Reposition-floating-toolbars-earlier.patch (text/plain), 2.68 KB, created by
Jonathan Druart
on 2018-07-20 16:08:24 UTC
(
hide
)
Description:
Bug 21099: Reposition floating toolbars earlier
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-20 16:08:24 UTC
Size:
2.68 KB
patch
obsolete
>From 765dc320d295c87d60c5a6850a12e06aeefce52d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 20 Jul 2018 12:59:16 -0300 >Subject: [PATCH] Bug 21099: Reposition floating toolbars earlier > >To recreate: >- Go to the advanced search form >- scrolldown to position the toolbar on top of the window >- scrollup > >https://screenshots.firefox.com/NnkFg3iOXqLPxfkd/pro.kohadev.org > >The toolbar should have been repositioned earlier > >Test plan: >Edit a patron >- scrolldown >- scrollup >- unfold the form in the header (tab "Search patrons", link "[+]") >- scrolldown >- scrollup >Advanced search >scrolldown >scrollup > >You should notice the difference with and without this patch >--- > .../intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js >index 36c99b0c0a..74633e7877 100644 >--- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js >+++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js >@@ -8,11 +8,17 @@ > var tbh = $(this); > var defaults = { > enabled: true, >- originalOffset: tbh.position().top >+ originalOffset: tbh.offset().top, >+ originalPosition: tbh.position().top, > }; > var originalOffset = typeof options.originalOffset === 'undefined' > ? defaults.originalOffset > : options.originalOffset; >+ >+ var originalPosition = typeof options.originalPosition === 'undefined' >+ ? defaults.originalPosition >+ : options.originalPosition; >+ > options = $.extend(defaults, options); > > if (tbh.css('position') !== 'absolute') { >@@ -34,14 +40,16 @@ > } > tbh.css({ > 'position': 'absolute', >- 'top': originalOffset >+ 'top': originalPosition, > }); > } > > if (options.enabled) { > $(window).scroll(function () { > var offsetTop = tbh.offset().top; >+ > var s = parseInt($(window).scrollTop(), 10); >+ > var fixMe = (s > offsetTop); > var repositionMe = (s < originalOffset); > if (fixMe) { >@@ -55,7 +63,7 @@ > if (repositionMe) { > tbh.css({ > 'position': 'absolute', >- 'top': originalOffset, >+ 'top': originalPosition, > 'z-index': '1' > }); > tbh.removeClass("floating"); >-- >2.11.0
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 21099
:
77164
|
77175
|
77388