diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-09 09:42:17 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-09 09:42:17 -0400 |
commit | 99be279ae3d6991ea5c0d813ebb5aa536b7631cc (patch) | |
tree | 56017fcebead6b451b6255ea2d5ee241be1b146c /web/js/010-control.js | |
parent | To work around Espen's corrupted image bug, we simply try to copy the image twice. The second time will usually work, unless the file is totally borked. (diff) | |
download | PhotoFloat-99be279ae3d6991ea5c0d813ebb5aa536b7631cc.tar.xz PhotoFloat-99be279ae3d6991ea5c0d813ebb5aa536b7631cc.zip |
Put photo segment at top and trim slashes from urls.
Diffstat (limited to '')
-rw-r--r-- | web/js/010-control.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/web/js/010-control.js b/web/js/010-control.js index 17cb8e2..f675508 100644 --- a/web/js/010-control.js +++ b/web/js/010-control.js @@ -281,10 +281,14 @@ $(document).ready(function() { var album_cache = new Array(); $(window).hashchange(function() { var new_album_cache = location.hash.substring(1); - if (new_album_cache.length && new_album_cache[0] == "!") - new_album_cache = new_album_cache.substring(1); - if (new_album_cache.length && new_album_cache[0] == "/") - new_album_cache = new_album_cache.substring(1); + if (new_album_cache.length) { + if (new_album_cache[0] == "!") + new_album_cache = new_album_cache.substring(1); + if (new_album_cache[0] == "/") + new_album_cache = new_album_cache.substring(1); + if (new_album_cache[new_album_cache.length - 1] == "/") + new_album_cache = new_album_cache.substring(0, new_album_cache.length - 1); + } var index = new_album_cache.lastIndexOf("/"); if (index != -1 && index != new_album_cache.length - 1) { previous_photo_cache = current_photo_cache; |