# HG changeset patch # User hertzhaft # Date 1295652403 -3600 # Node ID 9da101c9446503acb9435e5256e2fbc96b4ee2c4 # Parent 9ddcf007012205082bdf394bb6a860fc92ce7508 small birdview improvements diff -r 9ddcf0070122 -r 9da101c94465 client/digitallibrary/jquery/jquery-test-full.html --- a/client/digitallibrary/jquery/jquery-test-full.html Fri Jan 21 14:53:37 2011 +0100 +++ b/client/digitallibrary/jquery/jquery-test-full.html Sat Jan 22 00:26:43 2011 +0100 @@ -72,7 +72,9 @@ } div.birdzoom { - border: 2px solid yellow; + border-width: 2px; + border-style: solid; + border-color: yellow; } diff -r 9ddcf0070122 -r 9da101c94465 client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Fri Jan 21 14:53:37 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Sat Jan 22 00:26:43 2011 +0100 @@ -194,6 +194,8 @@ 'isBirdDivVisible' : false, // dimensions of bird's eye window 'birdDivOptions' : {'dw' : 200, 'dh' : 200}, + // style of bird's eye window + 'birdIndicatorStyle' : {'border' : '2px solid #ff0000' }, // is the "about" window shown? 'isAboutDivVisible' : false @@ -284,7 +286,6 @@ } // TODO: keep bird view visible after reload (parameter, cookie?) data.settings.isBirdDivVisible = showDiv(data.settings.isBirdDivVisible, data.$birdDiv, show); - showBirdIndicator(data); }, // goto given page nr (+/-: relative) @@ -764,15 +765,17 @@ var renderBirdArea = function (data) { var $ind = data.$birdDiv.find('div.birdzoom'); - var indRect = data.birdTrafo.transform(data.zoomArea); + var zoomArea = data.zoomArea; + var indRect = data.birdTrafo.transform(zoomArea); + //if (isFullArea(zoomArea)) return $ind.hide(); // TODO: set the coordinates all in one call? $ind.width(indRect.width); $ind.height(indRect.height); - $ind.offset({ left : indRect.x, top : indRect.y }); - // TODO: how to override this style with a CSS stylesheet? - if (!$ind.css('border')) $ind.css('border', '2px solid #ff0000'); + // offset minus frame width + $ind.offset({ left : indRect.x-2, top : indRect.y-2 }); + $ind.css(data.settings.birdIndicatorStyle); } - + // zooms by the given factor var zoomBy = function(data, factor) { var area = data.zoomArea; @@ -892,9 +895,8 @@ }; // auxiliary function (from old dllib.js) - isFullArea = function(data) { - var area = data.zoomArea; - return (area.width == 1.0) && (area.height == 1.0); + isFullArea = function(area) { + return (area.width === 1.0) && (area.height === 1.0); }; // auxiliary function (from Douglas Crockford, A.10)