# HG changeset patch
# User hertzhaft
# Date 1296408760 -3600
# Node ID c1b1c463bc44eb8b926f23b8a06eae4dd05b88d0
# Parent 667a316edb89e1bad8cacb4c33557687f1f79222
getting rid of bg div in zoomDrag
diff -r 667a316edb89 -r c1b1c463bc44 client/digitallibrary/jquery/jquery-test-embedded.html
--- a/client/digitallibrary/jquery/jquery-test-embedded.html Sun Jan 30 18:11:07 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-embedded.html Sun Jan 30 18:32:40 2011 +0100
@@ -34,6 +34,11 @@
z-index: 1;
}
+ div.scaler {
+ background-color: grey;
+ z-index: 0;
+ }
+
div.about {
position: absolute;
width: 200px;
@@ -48,11 +53,11 @@
display: none;
z-index: 1000;
}
-
+
td {
vertical-align: top;
}
-
+
#debug {
background-color: beige;
position: absolute;
@@ -61,7 +66,7 @@
font-family: Arial;
font-size: 9pt;
}
-
+
div._log {
color: grey;
}
@@ -73,7 +78,7 @@
div._error {
color: red;
}
-
+
div#test:hover {
background-color: cornsilk;
}
diff -r 667a316edb89 -r c1b1c463bc44 client/digitallibrary/jquery/jquery-test-full.html
--- a/client/digitallibrary/jquery/jquery-test-full.html Sun Jan 30 18:11:07 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-full.html Sun Jan 30 18:32:40 2011 +0100
@@ -69,8 +69,8 @@
display: none;
z-index: 1000;
}
-
- div.bgDrag {
+
+ div.scaler {
background-color: grey;
z-index: 0;
}
diff -r 667a316edb89 -r c1b1c463bc44 client/digitallibrary/jquery/jquery.digilib.js
--- a/client/digitallibrary/jquery/jquery.digilib.js Sun Jan 30 18:11:07 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js Sun Jan 30 18:32:40 2011 +0100
@@ -799,10 +799,12 @@
if (settings.interactionMode === 'fullscreen') {
var imgSize = getFullscreenImgSize($elem);
// fitwidth/height omits destination height/width
- if (data.dlOpts.fitheight !== '1') {
+ // if (data.dlOpts['fitheight'] !== '1') {
+ if (data.dlOpts['fitheight'] == null) {
settings.dw = imgSize.width;
}
- if (data.dlOpts.fitwidth !== '1') {
+ // if (data.dlOpts['fitwidth'] !== '1') {
+ if (data.dlOpts['fitwidth'] == null) {
settings.dh = imgSize.height;
}
$img = $('');
@@ -830,6 +832,9 @@
// setup image load handler before setting the src attribute (IE bug)
$img.load(scalerImgLoadedHandler(data));
$img.attr('src', scalerUrl);
+ // set scaler div size explicitly in case $img is hidden (for zoomDrag)
+ $imgRect = geom.rectangle($img);
+ $imgRect.adjustDiv(data.$scaler);
};
// creates HTML structure for buttons in elem
@@ -1043,13 +1048,15 @@
// returns function for load event of scaler img
var scalerImgLoadedHandler = function (data) {
- var $img = data.$img;
return function () {
console.debug("img loaded! this=", this, " data=", data);
// create Transform from current area and picsize
data.imgTrafo = getImgTrafo($img, data.zoomArea,
data.settings.rot, data.scalerFlags.hmir, data.scalerFlags.vmir);
console.debug("imgTrafo=", data.imgTrafo);
+ var $img = data.$img;
+ // show image in case it was hidden (for example in zoomDrag)
+ $img.show();
// display marks
renderMarks(data);
// TODO: digilib.showArrows(); // show arrow overlays for zoom navigation
@@ -1285,11 +1292,6 @@
var $elem = data.$elem;
var $scaler = data.$scaler;
var $img = data.$img;
- var $bg = $elem.has('div.bgDrag');
- if ($bg.length === 0) {
- $bg = $('