Bug 7466 - Cart notification popup should appear onscreen even when button isn't

This patch compares the scroll position of the window with the page
position of the cart button and displays the cart notification
popup at the top of the visible page if the cart button has moved
offscreen.

Includes fix for OPAC and staff client.

Signed-off-by: Aleksa Vujicic <aleksa@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Owen Leonard 2012-01-24 15:46:20 -05:00 committed by Paul Poulain
parent a406a5cbb0
commit 1eb0cbc5bf
2 changed files with 8 additions and 0 deletions

View file

@ -422,7 +422,11 @@ function vShelfAdd() {
function showCart(){
var position = $("#cartmenulink").offset();
var scrolld = $(window).scrollTop();
var top = position.top + $("#cartmenulink").outerHeight();
if( scrolld > top ){
top = scrolld + 15;
}
var left = position.left
$("#cartDetails").css("position","absolute").css("top",top);
$("#cartDetails").css("position","absolute").css("left",left);

View file

@ -428,7 +428,11 @@ function vShelfAdd() {
function showCart(){
var position = $("#cartmenulink").offset();
var scrolld = $(window).scrollTop();
var top = position.top + $("#cartmenulink").outerHeight();
if( scrolld > top ){
top = scrolld + 15;
}
var menuWidth = 200;
var buttonWidth = $("#cartmenulink").innerWidth();
var buttonOffset = menuWidth - buttonWidth;