Bugzilla – Attachment 51144 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]
Bug 16400: Let's hack the fixFloat plugin to fix our needs
Bug-16400-Lets-hack-the-fixFloat-plugin-to-fix-our.patch (text/plain), 5.32 KB, created by
Jonathan Druart
on 2016-05-03 14:04:57 UTC
(
hide
)
Description:
Bug 16400: Let's hack the fixFloat plugin to fix our needs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-03 14:04:57 UTC
Size:
5.32 KB
patch
obsolete
>From 81410537c2abd112cf156e364c7ab811bd02a358 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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' %] > <title>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 %])</title> > [% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> > [% INCLUDE 'calendar.inc' %] > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function() { >+ >+ var original_offset = $("#toolbar").position().top; >+ var additional_height = $("#filters").height(); >+ $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height }); >+ $("#filteraction_on").on("click", function(){ >+ $(window).off('scroll'); >+ $("#toolbar").css({ top: original_offset }); >+ $('#toolbar').fixFloat({ 'originalOffset': original_offset }); >+ }); >+ $("#filteraction_off").on("click", function(){ >+ $(window).off('scroll'); >+ $("#toolbar").css({ top: original_offset - additional_height}); >+ $('#toolbar').fixFloat({ 'originalOffset': original_offset - additional_height }); >+ }) >+ > [% IF categorycode %] > update_category_code( "[% categorycode %]" ); > [% ELSE %] >@@ -163,6 +179,23 @@ $(document).ready(function() { > [% END %] > [% END %] > [% END %] >+<div id="toolbar" class="btn-toolbar"> >+[% UNLESS ( check_member ) %] >+ <div class="btn-group"> >+ <button class="btn btn-small" id="saverecord" type="submit" name="save" onclick="return check_form_borrowers();"><i class="fa fa-save"></i> Save</button> >+ </div> >+ [% IF opadd %] >+ <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> >+ <div class="btn-group"> >+ <a class="btn btn-small cancel" id="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> >+ </div> >+ [% ELSE %] >+ <div class="btn-group"> >+ <a class="btn btn-small cancel" id="cancel" href="/cgi-bin/koha/members/member.pl?borrowernumber=[% borrowernumber %]">Cancel</a> >+ </div> >+ [% END %] >+[% END %] >+</div> > > [% IF ( step_1 ) %] > [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %] >@@ -1011,20 +1044,6 @@ $(document).ready(function() { > </fieldset> > [% END %] [% END %] > >-<fieldset class="rows" id="floating-save"> >-[% UNLESS ( check_member ) %] >- <fieldset class="action"> >- <button type="submit" name="save" onclick="return check_form_borrowers();"> >- <i class="fa fa-save"></i> Save >- </button> >- [% IF ( opadd ) %] >- <a class="cancel" href="/cgi-bin/koha/members/member.pl">Cancel</a> >- [% ELSE %] >- <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a> >- [% END %] >- </fieldset> >-[% END %] >-</fieldset> > </form> > > </div> >-- >2.7.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 16400
:
51043
|
51044
|
51144
|
51145
|
51449
|
51471
|
51517
|
51546
|
51547
|
51548
|
51549
|
51550
|
51551
|
51569
|
52765
|
52766
|
52767
|
52768
|
52769
|
52770