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>
(cherry picked from commit 1eb0cbc5bf)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Owen Leonard 2012-01-24 15:46:20 -05:00 committed by Chris Nighswonger
parent f4718e6b14
commit 53be89a5f0
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;