Bugzilla – Attachment 51546 Details for
Bug 16400
Proposal to uniform the placement of submit buttons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 16400: Update the fixFloat plugin
SIGNED-OFF-Bug-16400-Update-the-fixFloat-plugin.patch (text/plain), 4.83 KB, created by
Owen Leonard
on 2016-05-16 18:19:15 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16400: Update the fixFloat plugin
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-05-16 18:19:15 UTC
Size:
4.83 KB
patch
obsolete
>From a7de7eed6b4fc0672cd5f0a86dbe5e475f9d7fef Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 29 Apr 2016 18:17:01 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 16400: Update the fixFloat plugin >Content-Type: text/plain; charset="utf-8" > >I have updated it just in case it fixed the issue. >I don't think there are big changes between our current version and this >one, so keep it up-to-date > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../lib/jquery/plugins/jquery.fixFloat.js | 115 ++++++++++----------- > 1 file changed, 54 insertions(+), 61 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 0a6fde0..db0454c 100644 >--- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js >+++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js >@@ -1,68 +1,61 @@ > /* Source: http://www.webspeaks.in/2011/07/new-gmail-like-floating-toolbar-jquery.html > Revision: http://jsfiddle.net/pasmalin/AyjeZ/ > */ >-(function($){ >- $.fn.fixFloat = function(options){ >+(function ($, window) { >+ "use strict"; >+ $.fn.fixFloat = function (options) { >+ var defaults = { >+ enabled: true >+ }; >+ options = $.extend(defaults, options); >+ var tbh = $(this); >+ var originalOffset = tbh.position().top; > >- var defaults = { >- enabled: true >- }; >- var options = $.extend(defaults, options); >- >- var offsetTop; /**Distance of the element from the top of window**/ >- var s; /**Scrolled distance from the top of window through which we have moved**/ >- var fixMe = true; >- var repositionMe = true; >- >- var tbh = $(this); >- var originalOffset = tbh.position().top; /**Get the actual distance of the element from the top mychange:change to position better work**/ >- >- if (tbh.css('position')!='absolute') { >- var tbhBis = $("<div></div>"); >- tbhBis.css({"display":tbh.css("display"),"visibility":"hidden"}); >- tbhBis.width(tbh.outerWidth(true)); >- tbhBis.height(tbh.outerHeight(true)); >- tbh.after(tbhBis); >- tbh.width(tbh.width()); >- tbh.css({'position':'absolute'}); >- } >- >- if(options.enabled){ >- $(window).scroll(function(){ >- var offsetTop = tbh.offset().top; /**Get the current distance of the element from the top **/ >- var s = parseInt($(window).scrollTop(), 10); /**Get the from the top of wondow through which we have scrolled**/ >- var fixMe = true; >- if(s > offsetTop){ >- fixMe = true; >- }else{ >- fixMe = false; >+ if (tbh.css('position') !== 'absolute') { >+ var tbhBis = tbh.clone(); >+ tbhBis.css({ >+ "display": tbh.css("display"), >+ "visibility": "hidden" >+ }); >+ tbhBis.width(tbh.outerWidth(true)); >+ tbhBis.height(tbh.outerHeight(true)); >+ tbh.after(tbhBis); >+ tbh.width(tbh.width()); >+ var tbl = tbh.find("th,td"); >+ if (tbl.length > 0) { >+ tbl.each(function () { >+ var $elt = $(this); >+ $elt.width($elt.outerWidth(true)); >+ }); >+ } >+ tbh.css({ >+ 'position': 'absolute', >+ 'top': originalOffset >+ }); > } >+ tbh.css({ >+ 'z-index': 1000 >+ }); > >- if(s < originalOffset){ >- repositionMe = true; >- }else{ >- repositionMe = false; >+ 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) { >+ tbh.css({ >+ 'position': 'fixed', >+ 'top': '0' >+ }); >+ } >+ if (repositionMe) { >+ tbh.css({ >+ 'position': 'absolute', >+ 'top': originalOffset >+ }); >+ } >+ }); > } >- >- if(fixMe){ >- var cssObj = { >- 'position' : 'fixed', >- 'top' : '0px', >- 'z-index' : '1000' >- } >- tbh.css(cssObj); >- tbh.addClass("floating"); >- } >- if(repositionMe){ >- var cssObj = { >- 'position' : 'absolute', >- 'top' : originalOffset, >- 'z-index' : '1' >- } >- tbh.css(cssObj); >- tbh.removeClass("floating"); >- } >- }); >- } >- }; >-})(jQuery); >\ No newline at end of file >+ }; >+})(jQuery, window); >-- >2.1.4
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 16400
:
51043
|
51044
|
51144
|
51145
|
51449
|
51471
|
51517
|
51546
|
51547
|
51548
|
51549
|
51550
|
51551
|
51569
|
52765
|
52766
|
52767
|
52768
|
52769
|
52770