X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/a1edf3f1a7cff6e6f4d85a4288ca9b1d5cd3b254..527c5dba85fcdfd70755b6c1f899dbb21f5ec40a:/apps/wolnelektury_core/static/js/picture.js diff --git a/apps/wolnelektury_core/static/js/picture.js b/apps/wolnelektury_core/static/js/picture.js index 0c2e35b84..2464220e4 100644 --- a/apps/wolnelektury_core/static/js/picture.js +++ b/apps/wolnelektury_core/static/js/picture.js @@ -54,11 +54,13 @@ } 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-')) { - $("[href=#picutre-themes]").trigger('click'); + } else if (initial_hash.substr(0, themePrefix.length) === themePrefix) { + $("[href=#picture-themes]").trigger('click'); } mk = $("[href=" + initial_hash + "]").eq(0); self._initial_mark = self.createMark({