mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
Fix dnd
doesn't work for panes without a home being rendered
This commit is contained in:
parent
b41e078711
commit
d3a74b09b0
@ -42,6 +42,10 @@
|
|||||||
*/
|
*/
|
||||||
getTypeFor(target) {
|
getTypeFor(target) {
|
||||||
if (target.matches('.dashboard-settings')) {
|
if (target.matches('.dashboard-settings')) {
|
||||||
|
if (! target.querySelector('.home-list-control:first-child')) {
|
||||||
|
return this.widgetTypes.Dashboard;
|
||||||
|
}
|
||||||
|
|
||||||
return this.widgetTypes.DashboardHome;
|
return this.widgetTypes.DashboardHome;
|
||||||
} else if (target.matches('.dashboard-item-list')) {
|
} else if (target.matches('.dashboard-item-list')) {
|
||||||
return this.widgetTypes.Dashboard;
|
return this.widgetTypes.Dashboard;
|
||||||
@ -77,10 +81,11 @@
|
|||||||
}
|
}
|
||||||
case _this.widgetTypes.Dashboard: {
|
case _this.widgetTypes.Dashboard: {
|
||||||
let pane = item.dataset.icingaPane,
|
let pane = item.dataset.icingaPane,
|
||||||
home = orgEvt.to.closest('.home-list-control').dataset.icingaHome;
|
home = orgEvt.to.closest('.home-list-control, .dashboard-settings').dataset.icingaHome;
|
||||||
if (orgEvt.to !== orgEvt.from) {
|
if (orgEvt.to !== orgEvt.from) {
|
||||||
|
let homeList = orgEvt.from.closest('.home-list-control, .dashboard-settings');
|
||||||
data.originals = {
|
data.originals = {
|
||||||
originalHome : orgEvt.from.closest('.home-list-control').dataset.icingaHome,
|
originalHome : homeList.dataset.icingaHome,
|
||||||
originalPane : pane
|
originalPane : pane
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user