From 9510a1f3e1334ec6e92a7561b9bcb237cd15cb59 Mon Sep 17 00:00:00 2001 From: Gus Date: Wed, 20 Jan 2016 23:47:12 +0000 Subject: [PATCH] 15617 - Be able to close "Click to edit" text boxes after opening them To test: 1. Go to admin preferences, Acquisitions, Policy. 2. Find MarcFieldsToOrder and click "Click to Edit" 3. Notice that a "Click to collapse" button appears, click it. 4. Notice that the box has collapsed This fix should be applicable to all "Click to Edit" textboxes Signed-off-by: Owen Leonard Works well, and a nice improvement. Signed-off-by: Jonathan Druart Signed-off-by: Brendan A Gallagher --- .../intranet-tmpl/prog/en/js/pages/preferences.js | 12 +++++++++++- .../prog/en/modules/admin/preferences.tt | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js index b6537d9164..54286dea82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -96,13 +96,23 @@ $( document ).ready( function () { } ); $( '.prefs-tab .expand-textarea' ).show().click( function () { - $( this ).hide().nextAll( 'textarea, input[type=submit]' ) + $( this ).hide().nextAll( 'textarea, input[type=submit], a' ) .animate( { height: 'show', queue: false } ) .animate( { opacity: 1 } ); return false; } ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } ); + $( '.prefs-tab .collapse-textarea' ).hide().click( function () { + $( this ).show().prevAll( 'textarea, input[type=submit]' ) + .animate( { height: 'hide', queue: false } ) + .animate( { opacity: 0 } ); + + $( this ).hide().prevAll( 'a' ).show(); + return false; + }); + + $("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND); var collapsible = $(".collapsed,.expanded"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index 9d4b95f162..e42aca27f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -60,7 +60,7 @@
-
+
[% IF ( jump_not_found ) %]

System preferences

@@ -141,6 +141,7 @@ [% ELSE %] + [% END %] [% ELSIF ( CHUNK.type_languages ) %]
-- 2.39.5