From 5158c6e72fb24c87dd8c42a8d171222f1ee1d803 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 27 May 2014 11:06:13 +0200 Subject: [PATCH] Fix: Uglier but supported by Chrome --- apps/wolnelektury_core/static/js/picture.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/wolnelektury_core/static/js/picture.js b/apps/wolnelektury_core/static/js/picture.js index b058967b2..2464220e4 100644 --- a/apps/wolnelektury_core/static/js/picture.js +++ b/apps/wolnelektury_core/static/js/picture.js @@ -54,10 +54,12 @@ } 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); -- 2.20.1