check if element is sortable before removing sortable property
authorBenjamin H盲ublein <BenjaminHae@users.noreply.github.com>
Sat, 26 Sep 2015 12:32:14 +0000 (14:32 +0200)
committerBenjamin H盲ublein <BenjaminHae@users.noreply.github.com>
Sat, 26 Sep 2015 12:32:14 +0000 (14:32 +0200)
htdocs/js/mpd.js

index fb2dd82..b30bd6c 100644 (file)
@@ -273,7 +273,9 @@ function webSocketConnect() {
                      * some browsers, such as Safari, from changing the normalization form of the
                      * URI from NFD to NFC, breaking our link with MPD.
                      */
-                    $('#salamisandwich > tbody').sortable('destroy');
+                    if ($('#salamisandwich > tbody').is(':ui-sortable')) {
+                        $('#salamisandwich > tbody').sortable('destroy');
+                    }
                     for (var item in obj.data) {
                         switch(obj.data[item].type) {
                             case "directory":