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 <oleonard@myacpl.org> Works well, and a nice improvement. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
parent
7dc0c67640
commit
9510a1f3e1
2 changed files with 13 additions and 2 deletions
|
@ -96,13 +96,23 @@ $( document ).ready( function () {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$( '.prefs-tab .expand-textarea' ).show().click( 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( { height: 'show', queue: false } )
|
||||||
.animate( { opacity: 1 } );
|
.animate( { opacity: 1 } );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } );
|
} ).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);
|
$("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND);
|
||||||
var collapsible = $(".collapsed,.expanded");
|
var collapsible = $(".collapsed,.expanded");
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
|
<a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
|
||||||
<textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea>
|
<textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea>
|
||||||
|
<a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
|
||||||
[% END %]
|
[% END %]
|
||||||
[% ELSIF ( CHUNK.type_languages ) %]
|
[% ELSIF ( CHUNK.type_languages ) %]
|
||||||
<dl>
|
<dl>
|
||||||
|
|
Loading…
Reference in a new issue