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:
parent
a406a5cbb0
commit
1eb0cbc5bf
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue