From 5234e97d5eb6159ef8ce3652cd19e4eee0bec7dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benjamin=20H=E7=9B=B2ublein?= Date: Sat, 26 Sep 2015 14:32:14 +0200 Subject: [PATCH] check if element is sortable before removing sortable property --- htdocs/js/mpd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index fb2dd82..b30bd6c 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -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": -- 2.20.1