Bug 39400: "Jump to add item form" doesn't work while editing an existing item
The link at the top of the item editor page to "Jump to add item form"
tries to scrollIntoView the element with id="additema", but that element
only exists while you are adding a new item. While you are editing an
existing item, it is replaced by an element with id="edititem".
Whichever element you have at the moment is always just below the form
with id="f", so we can just scroll that into view instead.
Test plan:
1. Without the patch, go to the details page for any bib record with at
least one item, and click the Edit button on the row for an item in
the holdings table.
2. You should be scrolled down to the form for editing that item
3. Scroll up to the top of the page, click the Jump to add item form
link
4. You will not be scrolled back down to the form
5. Apply patch, shift+reload page
6. Now the link should scroll you back down to the form
7. Return to the biblio details page, click Edit - Manage items and
verify that the Jump to add item form link still works when you are
not editing an existing item
8. Click the Add multiple copies of this item button and add 30 items
9. Make sure that the link still scrolls the form into view both while
you are editing an existing item, and while you are adding a new item
Sponsored-by: Chetco Community Public Library
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
7fb30a073e
commit
fcf705e2e3
|
|
@ -87,7 +87,7 @@
|
|||
</div>
|
||||
[% END %]
|
||||
<h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %]by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
|
||||
<a id="newitem_jump" href="#additema"><i class="fa fa-arrow-down"></i> Jump to add item form</a>
|
||||
<a id="newitem_jump" href="#f"><i class="fa fa-arrow-down"></i> Jump to add item form</a>
|
||||
|
||||
[% IF ( barcode_not_unique ) %]<div class="alert alert-warning"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
|
||||
[% IF ( no_next_barcode ) %]<div class="alert alert-warning"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ $(document).ready(function () {
|
|||
|
||||
$("#newitem_jump").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
document.getElementById("additema").scrollIntoView();
|
||||
document.getElementById("f").scrollIntoView();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue