Fix: Uglier but supported by Chrome
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 27 May 2014 09:06:13 +0000 (11:06 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 27 May 2014 09:06:13 +0000 (11:06 +0200)
apps/wolnelektury_core/static/js/picture.js

index b058967..2464220 100644 (file)
       }
       var initial_hash = window.location.hash;
       if (initial_hash) {
-       var mk = null;
-       if (initial_hash.startsWith('#object-')) {
+       var mk = null,
+        objectPrefix = '#object-',
+        themePrefix = '#theme-';
+       if (initial_hash.substr(0, objectPrefix.length) === objectPrefix) {
          $("[href=#picture-objects]").trigger('click');
-       } else if (initial_hash.startsWith('#theme-')) {
+       } else if (initial_hash.substr(0, themePrefix.length) === themePrefix) {
          $("[href=#picture-themes]").trigger('click');
        }
        mk = $("[href=" + initial_hash + "]").eq(0);