# HG changeset patch # User robcast # Date 1298056155 -3600 # Node ID b07d1824ca2aeb32dac1c9fdbe96a3a44420d1b8 # Parent 6914ddedaca78d30a86d6ea9ec48902ea1b1b672 fullscreen mode works without reload on browsers supporting history.pushstate! diff -r 6914ddedaca7 -r b07d1824ca2a client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Fri Feb 18 19:46:09 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Fri Feb 18 20:09:15 2011 +0100 @@ -869,11 +869,20 @@ // update location.href (browser URL) in fullscreen mode var url = getDigilibUrl(data); var history = window.history; - if (typeof(history.pushState) === 'function') { - console.debug("we could modify history, but we don't..."); - } - // reload window - window.location = url; + if (typeof history.pushState === 'function') { + console.debug("faking reload to "+url); + // change url without reloading (stateObj, title, url) + history.pushState({}, '', url); + // change img src + var imgurl = getScalerUrl(data); + data.$img.attr('src', imgurl); + highlightButtons(data); + // send event + $(data).trigger('redisplay'); + } else { + // reload window + window.location = url; + } } else { // embedded mode -- just change img src var url = getScalerUrl(data); @@ -1614,7 +1623,7 @@ var args = Array.prototype.slice.call(arguments, 1); args.unshift(data); return actions[action].apply(this, args); - } else if (typeof(action) === 'object' || !action) { + } else if (typeof action === 'object' || !action) { // call init on this return actions.init.apply(this, arguments); } else {