# HG changeset patch
# User robcast
# Date 1296515522 -3600
# Node ID 6224f64cbd58cd73b3105fddf08da543827124f3
# Parent 936d88972cd0bf8b44d5c312abcb729f21d67121
fixed birdZoomDiv positioning in embedded mode
diff -r 936d88972cd0 -r 6224f64cbd58 client/digitallibrary/jquery/jquery-test-embedded-rc.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/jquery-test-embedded-rc.html Tue Feb 01 00:12:02 2011 +0100
@@ -0,0 +1,108 @@
+
+
+
+ Digilib jQuery Test: embedded
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+ |
+
+
+
+ 
+
+ |
+
+
+
+ 
+
+ |
+
+
+
+ 
+
+ |
+
+
+ DEBUG
+
+

+

+
+
+
+
diff -r 936d88972cd0 -r 6224f64cbd58 client/digitallibrary/jquery/jquery.digilib.css
--- a/client/digitallibrary/jquery/jquery.digilib.css Mon Jan 31 17:44:20 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.css Tue Feb 01 00:12:02 2011 +0100
@@ -13,13 +13,18 @@
z-index: 10;
}
-
div.digilib div.zoomrect {
position: absolute;
border: 2px solid #ff0000;
z-index: 100;
}
+div.digilib div.birdzoom {
+ position: absolute;
+ border: 2px solid #ff0000;
+ z-index: 100;
+}
+
div.digilib div.mark {
position: absolute;
color: white;
@@ -92,4 +97,4 @@
position: absolute;
bottom: 0px;
right: 0px;
-}
\ No newline at end of file
+}
diff -r 936d88972cd0 -r 6224f64cbd58 client/digitallibrary/jquery/jquery.digilib.js
--- a/client/digitallibrary/jquery/jquery.digilib.js Mon Jan 31 17:44:20 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js Tue Feb 01 00:12:02 2011 +0100
@@ -335,11 +335,13 @@
// event handler: toggles the visibility of the bird's eye window
showBirdDiv : function (data, show) {
+ var settings = data.settings;
if (data.$birdDiv == null) {
// no bird div -> create
setupBirdDiv(data);
}
- data.settings.isBirdDivVisible = showDiv(data.settings.isBirdDivVisible, data.$birdDiv, show);
+ settings.isBirdDivVisible = showDiv(settings.isBirdDivVisible, data.$birdDiv, show);
+ updateBirdDiv(data);
storeOptions(data);
// data.$birdImg.triggerHandler('load'); // TODO: we shouldn't do that
},
@@ -788,8 +790,8 @@
// embedded mode -- just change img src
var url = getScalerUrl(data);
data.$img.attr('src', url);
- // load new bird img (in case the scalerUrl has changed, like in gotopage)
- //showBirdDiv(data); //TODO: change url explicitly
+ // redisplay bird img
+ updateBirdDiv(data);
}
};
@@ -934,7 +936,7 @@
// the bird's eye div
var $birdDiv = $('');
// the detail indicator frame
- var $birdZoom = $('');
+ var $birdZoom = $('');
// the small image
var $birdImg = $('
');
data.$birdDiv = $birdDiv;
@@ -1154,6 +1156,10 @@
$birdZoom.offset(coords);
} else {
// nice animation for embedded mode :-)
+ var ppos = $birdZoom.offsetParent().offset();
+ // correct offsetParent because animate is relative
+ coords.left = (coords.left - ppos.left) + 'px' ;
+ coords.top = (coords.top - ppos.top) + 'px';
$birdZoom.animate(coords);
}
};