ACQ scroll back to top of lineitem info page user/berick/acq-item-focus-repairs
authorBill Erickson <berick@esilibrary.com>
Mon, 17 Sep 2012 18:50:36 +0000 (14:50 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 3 Oct 2012 19:35:22 +0000 (15:35 -0400)
commit91d75e2288207ab3c6c09c6a1ce6b76e7ea32e0b
tree75b9a52bda84b88bd3805df529e8c82a99b25aed
parent290a8d27d7bc7dccdcc91c00ab2db7183f01800d
ACQ scroll back to top of lineitem info page

When displaying the lineitem "info" page (li attributes, marc record),
be sure to scroll to the top of the page instead of relying on the
previous scroll location.  In particular, if you last viewed a LI
toward the bottom of the page, returned (causes scroll down), then go
back into the info page, the page will be scrolled to the bottom.

The solution is a little funkier than I'd hoped.  The scroll-to point
has to be a node that is a) within the scrolling dojo div and b). non-
visible when scrollIntoView is called.  Since the top-level
page div may be different, depending on who is loading li_table, we rely
on the caller to place an id=oils-scroll-to-top div in the page for
general top-scrolling.  (Note, also, window.scrollTo does not work when
it's the div and not the full page that needs scrolling).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/acq/picklist/view.tt2
Open-ILS/src/templates/acq/po/view.tt2
Open-ILS/src/templates/acq/search/unified.tt2
Open-ILS/web/js/ui/default/acq/common/li_table.js