Bugzilla – Attachment 51044 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.56 KB, created by
Jonathan Druart
on 2016-04-29 18:07:19 UTC
(
hide
)
Description:
Bug 16400: Let's hack the fixFloat plugin to fix our needs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-04-29 18:07:19 UTC
Size:
5.56 KB
patch
obsolete
>From 6c284a651e8b2c88ec2688abf08c7762a241d5e4 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 | 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' %] > <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 %] >@@ -59,7 +73,6 @@ $(document).ready(function() { > mrform.hide(); > e.preventDefault(); > }); >- $('#floating-save').css( { bottom: parseInt( $('#floating-save').css('bottom') ) + $('#changelanguage').height() + 'px' } ); > }); > > function clear_entry(node) { >@@ -299,6 +312,23 @@ function select_user(borrowernumber, borrower) { > [% 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 %] >@@ -1147,20 +1177,6 @@ function select_user(borrowernumber, borrower) { > </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