linuxserver / Heimdall

An Application dashboard and launcher
MIT License
7.46k stars 540 forks source link

Error on javascript console: $(...).sortable is not a function #1352

Open lyricnz opened 4 days ago

lyricnz commented 4 days ago
jquery.min.js:2 jQuery.Deferred exception: $(...).sortable is not a function TypeError: $(...).sortable is not a function
    at HTMLDocument.<anonymous> (http://heimdalldashboard:7990/js/app.js?id=5446aeb4aa754e641c77:633:18)
    at e (http://heimdalldashboard:7990/js/jquery.min.js:2:30310)
    at t (http://heimdalldashboard:7990/js/jquery.min.js:2:30612) undefined
lyricnz commented 4 days ago

The code in js/app.js like 633 is the first line of below.

  $('#sortable').sortable({
    stop: function stop(event, ui) {
      var idsInOrder = $('#sortable').sortable('toArray', {
        attribute: 'data-id'
      });
      $.post(base + 'order', {
        order: idsInOrder
      });
    }
  });
lyricnz commented 4 days ago

This is 2.6.1 btw

lyricnz commented 4 days ago

It looks like "sortable" is part of jquery-ui not jquery? https://jqueryui.com/sortable/

Certainly adding the middle line below to ./resources/views/layouts/app.blade.php seems to have fixed the specific issue

        <script src="{{ asset('js/jquery.min.js') }}"></script>
        <script src="{{ asset('js/jquery-ui.min.js') }}"></script>
        <script src="{{ asset(mix('js/app.js')) }}"></script>