mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:49:06 +01:00
Check element exist before applying to sortable as sortablejs needs an HTMLElement instance
This commit is contained in:
parent
4e7ebc509a
commit
466371fa03
@ -783,17 +783,20 @@ export abstract class EgwApp
|
|||||||
.addClass("ui-helper-clearfix");
|
.addClass("ui-helper-clearfix");
|
||||||
|
|
||||||
let el = document.getElementById('favorite_sidebox_'+this.appname)?.getElementsByTagName('ul')[0];
|
let el = document.getElementById('favorite_sidebox_'+this.appname)?.getElementsByTagName('ul')[0];
|
||||||
let sortablejs = Sortable.create(el, {
|
if (el && el instanceof HTMLElement)
|
||||||
ghostClass: 'ui-fav-sortable-placeholder',
|
{
|
||||||
draggable: 'li:not([data-id$="add"])',
|
let sortablejs = Sortable.create(el, {
|
||||||
delay: 25,
|
ghostClass: 'ui-fav-sortable-placeholder',
|
||||||
dataIdAttr:'data-id',
|
draggable: 'li:not([data-id$="add"])',
|
||||||
onSort: function(event){
|
delay: 25,
|
||||||
let favSortedList = sortablejs.toArray();
|
dataIdAttr:'data-id',
|
||||||
self.egw.set_preference(self.appname,'fav_sort_pref',favSortedList);
|
onSort: function(event){
|
||||||
self._refresh_fav_nm();
|
let favSortedList = sortablejs.toArray();
|
||||||
}
|
self.egw.set_preference(self.appname,'fav_sort_pref',favSortedList);
|
||||||
});
|
self._refresh_fav_nm();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Bind favorite de-select
|
// Bind favorite de-select
|
||||||
var egw_fw = egw_getFramework();
|
var egw_fw = egw_getFramework();
|
||||||
|
Loading…
Reference in New Issue
Block a user