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>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
[% ctx.page_title = 'Selection List' %]
<div dojoType="dijit.layout.ContentPane" style="height:100%">
<div class='container'>
+ <div id='oils-scroll-to-top'></div>
<div id='oils-acq-picklist-header'>
Selection list <span id='oils-acq-picklist-name'> </span>
<div class='oils-acq-picklist-attributes'>
[% WRAPPER 'base.tt2' %]
[% ctx.page_title = "Purchase Order" %]
<div dojoType="dijit.layout.ContentPane" style="height:100%">
+ <div id='oils-scroll-to-top'></div>
<div>
<div id='oils-acq-picklist-header'>
<big>
<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/acq/search/picklist.js"></script>
<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/acq/search/purchase_order.js"></script>
<div id="acq-unified-body" class="hidden">
+ <div id='oils-scroll-to-top'></div>
<div id="acq-unified-heading">
<span id="acq-unified-heading-actual">Acquisitions Search</span>
<span id="acq-unified-heading-controls">
oilsBasePath + "/acq/lineitem/related/" + li.id();
}
+ // if a top scroll point is defined, jump up to it here
+ var node = dojo.byId('oils-scroll-to-top');
+ if (node) dijit.scrollIntoView(node);
};
this.generateMakeRecTab = function(bib_id,default_view, row) {