JS: Replace jquery.find() with pure js

This commit is contained in:
Yonas Habteab 2022-04-01 16:57:59 +02:00
parent 96c3b31686
commit d903b902fc

View File

@ -161,8 +161,9 @@
Dashboard.prototype.onRendered = function (e) {
let _this = e.data.self;
$(e.target).find('.dashboard-settings, .dashboard.content, .dashboard-item-list, .dashlet-item-list').each(function () {
let groupName = _this.getTypeFor(this),
e.target.querySelectorAll('.dashboard-settings, .dashboard.content, .dashboard-item-list, .dashlet-item-list')
.forEach(sortable => {
let groupName = _this.getTypeFor(sortable),
draggable,
handle;
@ -181,7 +182,7 @@
}
case WIDGET_TYPES.Dashlet: {
groupName = WIDGET_TYPES.Dashlet;
if (this.matches('.dashboard.content')) {
if (sortable.matches('.dashboard.content')) {
draggable = '> .container';
} else {
draggable = '.dashlet-list-item';
@ -205,7 +206,7 @@
}
};
Sortable.create(this, options);
Sortable.create(sortable, options);
});
};