LP1925237: Define $() when jQuery not in use user/jboyer/lp1925237_dollar_what
authorJason Boyer <JBoyer@equinoxOLI.org>
Fri, 24 Sep 2021 18:20:16 +0000 (14:20 -0400)
committerJason Boyer <JBoyer@equinoxOLI.org>
Fri, 24 Sep 2021 18:20:16 +0000 (14:20 -0400)
There are enough places that we enjoy the brvty of $() that it needs
to be defined even if jQuery isn't available.

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Open-ILS/src/templates/opac/parts/js.tt2

index aa4e9f5..412bdf6 100644 (file)
@@ -4,6 +4,12 @@
 
 [% IF ctx.want_jquery || ctx.readonly %]
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/common/build/js/jquery.min.js[% ctx.cache_key %]"></script>
+[% ELSE %]
+<script type="text/javascript">
+  function $(id) {
+    return document.getElementById(id);
+  }
+</script>
 [% END; # ctx.want_jquery %]
 
 [% IF ctx.readonly %]