Prevent "calling draggable before initailization" errors

Elastic skin disables dragging on folders list, so we have to check
if it's still draggable before we call draggable() again. Otherwise
it will throw an error.
pull/6114/head
Aleksander Machniak 7 years ago
parent a2875cdda9
commit 5f26d9bf34

@ -7121,7 +7121,9 @@ function rcube_webmail()
}
// disable drag-n-drop temporarily
this.subscription_list.draggable('destroy').droppable('destroy');
// some skins disable dragging in mobile mode, so we have to check if it is still draggable
if (this.subscription_list.is_draggable())
this.subscription_list.draggable('destroy').droppable('destroy');
var row, n, tmp, tmp_name, rowid, collator, pos, p, parent = '',
folders = [], list = [], slist = [],

@ -89,6 +89,7 @@ function rcube_treelist_widget(node, p)
this.intersects = intersects;
this.droppable = droppable;
this.draggable = draggable;
this.is_draggable = is_draggable;
this.update = update_node;
this.insert = insert;
this.remove = remove;
@ -1245,6 +1246,11 @@ function rcube_treelist_widget(node, p)
return this;
}
function is_draggable()
{
return !!ui_draggable;
}
}
// use event processing functions from Roundcube's rcube_event_engine

Loading…
Cancel
Save