From 81410537c2abd112cf156e364c7ab811bd02a358 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 | 11 +++-- .../prog/en/modules/members/memberentrygen.tt | 47 +++++++++++++++------- 2 files changed, 40 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..fb9ffcf 100644 --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js +++ b/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.fixFloat.js @@ -3,13 +3,16 @@ */ (function ($, window) { "use strict"; - $.fn.fixFloat = function (options) { + $.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 35340ee..1ed5f28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -3,10 +3,26 @@ [% 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' %]