changeset 993:862d2ae56c20

fixed problems with new events and some browsers.
author robcast
date Tue, 07 Feb 2012 00:24:21 +0100
parents 4fcc85d4db8f
children 8be56a27db58
files webapp/src/main/webapp/jquery/jquery.digilib.js webapp/src/main/webapp/jquery/jquery.digilib.marks.js
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Mon Feb 06 23:03:17 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Tue Feb 07 00:24:21 2012 +0100
@@ -192,6 +192,8 @@
                 data.hasPreviewBg = false;
                 // check if browser supports AJAX-like URL-replace without reload
                 data.hasAsyncReload = (typeof history.replaceState === 'function');
+                // check if browser sets complete on cached images
+                data.hasCachedComplete = ! $.browser.mozilla;
                 // check digilib base URL
                 if (elemSettings.digilibBaseUrl == null) {
                     if (isFullscreen) {
@@ -794,7 +796,10 @@
                 	var imgurl = getScalerUrl(data);
                 	$img.attr('src', imgurl);
                 	// trigger load event if image is cached. Doesn't work with Firefox!!
-                	//if ($img.prop('complete')) $img.trigger('load');
+                	if (data.hasCachedComplete && $img.prop('complete')) {
+                	    console.debug("cached img.load");
+                	    $img.trigger('load');
+                	}
                 	if (data.scalerFlags.clip != null || data.scalerFlags.osize != null) {
                     	// we need image info, do we have it?
                 		if (data.imgInfo == null) {
@@ -1314,9 +1319,8 @@
                 $img.css('visibility', 'visible');
                 $scaler.css({'opacity' : '1', 'background-image' : 'none'});
                 data.hasPreviewBg = false;
-                // unhide marks FIXME!
-                //data.$elem.find('div.mark').show();
-                $(data).trigger('redisplay');
+                // unhide marks etc.
+                updateDisplay(data);
                 return false; 
             }
             // get old zoom area (screen coordinates)
--- a/webapp/src/main/webapp/jquery/jquery.digilib.marks.js	Mon Feb 06 23:03:17 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.marks.js	Tue Feb 07 00:24:21 2012 +0100
@@ -57,7 +57,7 @@
     // plugin installation called by digilib on plugin object.
     var install = function(plugin) {
         digilib = plugin;
-        console.debug('installing stub plugin. digilib:', digilib);
+        console.debug('installing marks plugin. digilib:', digilib);
         // import geometry classes
         geom = digilib.fn.geometry;
         // add defaults, actins, buttons
@@ -79,7 +79,7 @@
     };
 
     var handleUpdate = function(evt) {
-        console.debug("stub: handleUpdate");
+        console.debug("marks: handleUpdate");
         var data = this;
         renderMarks(data);
     };