Don't allow sorting when the edit-list is filtered to prevent messing up the sort order

This commit is contained in:
Kevin MacMartin 2018-01-13 01:16:19 -05:00
parent f74c71446a
commit fb7f87d6b0
2 changed files with 84 additions and 65 deletions

View file

@ -234,9 +234,19 @@ function editListInit() {
// empty the filter // empty the filter
$filter.val(""); $filter.val("");
// initialize the filter list functionality
const filterList = new List("edit-list-wrapper", { const filterList = new List("edit-list-wrapper", {
valueNames: [ "title-column" ] valueNames: [ "title-column" ]
}); });
// add/remove a filtered class to identify when the list is filtered
$filter.on("input", function() {
if ($filter.val() === "") {
$editList.removeClass("filtered");
} else {
$editList.addClass("filtered");
}
});
} }
}; };

View file

@ -245,7 +245,8 @@ body {
} }
} }
&.edit-list .list-group-item { &.edit-list {
.list-group-item {
padding-top: 4px; padding-top: 4px;
padding-bottom: 4px; padding-bottom: 4px;
@ -271,6 +272,8 @@ body {
.sort-icon { .sort-icon {
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
opacity: 1;
transition: opacity 100ms;
cursor: grab; cursor: grab;
cursor: -webkit-grabbing; cursor: -webkit-grabbing;
@ -327,6 +330,12 @@ body {
} }
} }
} }
&.filtered .list-group-item .title-column .sort-icon {
opacity: 0.5;
pointer-events: none;
}
}
} }
.edit-item { .edit-item {