From 6c284a651e8b2c88ec2688abf08c7762a241d5e4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Apr 2016 19:01:10 +0100 Subject: [PATCH] Bug 16400: Let's hack the fixFloat plugin to fix our needs On comment bug 11088 comment 2, Owen explained the problem with the fixFloat toolbar. Since we have a hidden div, the plugin does not manage to place the toolbar correctly. In order to make it work, this patch adds some changes to the plugin to add the ability to define our own offset. When the div is extended (+, filteraction_on), the offset should be updated to move the toolbar. Same when the div is folded (-, filteraction_off) --- .../lib/jquery/plugins/jquery.fixFloat.js | 9 +++-- .../prog/en/modules/members/memberentrygen.tt | 46 +++++++++++++++------- 2 files changed, 37 insertions(+), 18 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 db0454c..a799bf6 100644 --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js +++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js @@ -4,12 +4,15 @@ (function ($, window) { "use strict"; $.fn.fixFloat = function (options) { + var tbh = $(this); var defaults = { - enabled: true + enabled: true, + originalOffset: tbh.position().top }; + var originalOffset = typeof options.originalOffset === 'undefined' + ? defaults.originalOffset + : options.originalOffset; options = $.extend(defaults, options); - var tbh = $(this); - var originalOffset = tbh.position().top; if (tbh.css('position') !== 'absolute') { var tbhBis = tbh.clone(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 6086b3c..578af2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -3,11 +3,25 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › [% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] patron [% IF (firstname) %][% firstname %] [% END %][% IF (surname) %][% surname %] [% END %]([%IF ( categoryname ) %][% categoryname %][% ELSE %][% IF ( I ) %]Organization[% END %][% IF ( A ) %]Adult[% END %][% IF ( C ) %]Child[% END %][% IF ( P ) %]Professional[% END %][% IF ( S ) %]Staff[% END %][% END %]) [% INCLUDE 'doc-head-close.inc' %] + [% INCLUDE 'calendar.inc' %]