templates/base_templates/javascripts.html.twig line 1

  1. <div id="porukeMobitel"
  2.      style="display: none; margin: 0px auto; position: fixed; transition: all 0.5s ease-in-out 0s; z-index: 1031; top: 10px; left: 10px; width: 95%; animation-iteration-count: 1;"></div>
  3. <script src="{{ asset('js/jquery-3.3.1.min.js') }}"></script>
  4. <script src="{{ asset('js/vendors/bootstrap/bootstrap.bundle.min.js') }}"></script>
  5. {% if app.user %}
  6.     <script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
  7.     <script src="{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}"></script>
  8.     <script src="{{ asset('js/vendors/slimscroll/jquery.slimscroll.min.js') }}"></script>
  9.     <script src="{{ asset('js/app.js') }}"></script>
  10.     <script>
  11.         let isMobile = window.matchMedia("only screen and (max-width: 990px)").matches;
  12.         $('#collapse').on('click', function () {
  13.             $.ajax({
  14.                 method: 'PATCH',
  15.                 url: Routing.generate('operateri-izbornik-vidljiv'),
  16.                 data: {data: $('body').hasClass("compact-menu")},
  17.                 dataType: 'JSON'
  18.             });
  19.             return false;
  20.         });
  21.         let primarnaBoja = '{{ app.user.city.color }}';
  22.         $("input.color").val(primarnaBoja);
  23.         $('body').css("--primarycolor", primarnaBoja);
  24.         $('#svg_6').attr('fill', primarnaBoja);
  25.         if (!isMobile) {
  26.             {% if app.user.menuVisibility %}
  27.             $('body').toggleClass('compact-menu');
  28.             $('.sidebar').toggleClass('active');
  29.             {% endif %}
  30.         }
  31.         {% for msg in app.session.flashBag.get('success') %}
  32.         flashBagMessage(isMobile, '{{ msg|raw }}', 'primary');
  33.         {% endfor %}
  34.         {% for msg in app.session.flashBag.get('info') %}
  35.         flashBagMessage(isMobile, '{{ msg|raw }}', 'secondary');
  36.         {% endfor %}
  37.         {% for msg in app.session.flashBag.get('error') %}
  38.         flashBagMessage(isMobile, '{{ msg|raw }}', 'danger');
  39.         {% endfor %}
  40.     </script>
  41. {% endif %}