tiles: Also show proper d&d cursors and lock drag during progress

This commit is contained in:
Johannes Meyer 2019-03-01 08:39:20 +01:00
parent dc69522ae5
commit 00fcce8192
2 changed files with 21 additions and 5 deletions

View file

@ -479,6 +479,19 @@ td > a > .badges {
}
}
.tiles.sortable:not([data-sortable-disabled="true"]) {
> div {
cursor: grab;
&.sortable-chosen {
cursor: grabbing;
}
}
&.progress > div {
cursor: wait;
}
}
.tiles > div.parent::before {
content: '&';

View file

@ -106,11 +106,8 @@
var evt = event.originalEvent;
if (evt.oldIndex !== evt.newIndex) {
var $source = $(evt.from);
var actionUrl = [
$source.data('actionUrl'),
'action=move',
'movenode=' + $(evt.item).data('nodeName')
].join('&');
$source.addClass('progress')
.data('sortable').option('disabled', true);
var data = {
csrfToken: $source.data('csrfToken'),
@ -120,6 +117,12 @@
to: evt.newIndex
};
var actionUrl = [
$source.data('actionUrl'),
'action=move',
'movenode=' + $(evt.item).data('nodeName')
].join('&');
var $container = $source.closest('.container');
var req = icinga.loader.loadUrl(actionUrl, $container, data, 'POST');
req.complete(function (req, textStatus) {