[SSE] Pivot settings: drag and drop (fix style of insert)

This commit is contained in:
Julia Svinareva 2019-11-07 12:51:11 +03:00
parent ef84781e99
commit 23817335de
2 changed files with 16 additions and 6 deletions

View file

@ -216,12 +216,12 @@ define([
onDragItemEnter: function (item, index, event) {
event.preventDefault();
item.$el.css({'border-top-color': '#b7b7b7'});
item.$el.addClass('insert');
this.indexMoveTo = index;
},
onDragItemLeave: function (item, index, event) {
item.$el.css({'border-top-color': '#fafafa'});
item.$el.removeClass('insert');
this.indexMoveTo = undefined;
},
@ -231,7 +231,7 @@ define([
} else {
event.preventDefault(); // Necessary. Allows us to drop.
event.originalEvent.dataTransfer.dropEffect = 'move';
item.$el.css({'border-top-color': '#b7b7b7'});
item.$el.addClass('insert');
this.indexMoveTo = index;
return false;
}
@ -248,13 +248,13 @@ define([
} else {
event.preventDefault(); // Necessary. Allows us to drop.
event.originalEvent.dataTransfer.dropEffect = 'move';
listview.$el.find('.item').last().css({'border-bottom-color': '#b7b7b7'});
listview.$el.find('.item').last().addClass('insert last');
return false;
}
},
onDragLeave: function (listview, event) {
listview.$el.find('.item').css({'border-top-color': '#fafafa', 'border-bottom-color': '#ddd'});
listview.$el.find('.item').removeClass('insert last');
},
onDrop: function (event) {

View file

@ -388,8 +388,18 @@ button:active:not(.disabled) .btn-change-shape {background-position: -56px -
width: 95px;
height: 130px;
.item {
.listview:not(.disabled) > .item {
padding: 3px;
border-top: none;
&.insert {
background: linear-gradient(to bottom, #656565, #fff 5%);
&.last {
background: linear-gradient(to top, #656565, #fff 5%);
}
}
&:hover {
border-top: none;
}
}
.list-item > div:nth-child(1) {