mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-22 07:54:11 -05:00
Don't allow sorting when the edit-list is filtered to prevent messing up the sort order
This commit is contained in:
parent
f74c71446a
commit
fb7f87d6b0
2 changed files with 84 additions and 65 deletions
10
resources/assets/js/dashboard.js
vendored
10
resources/assets/js/dashboard.js
vendored
|
@ -234,9 +234,19 @@ function editListInit() {
|
|||
// empty the filter
|
||||
$filter.val("");
|
||||
|
||||
// initialize the filter list functionality
|
||||
const filterList = new List("edit-list-wrapper", {
|
||||
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");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
11
resources/assets/sass/dashboard.scss
vendored
11
resources/assets/sass/dashboard.scss
vendored
|
@ -245,7 +245,8 @@ body {
|
|||
}
|
||||
}
|
||||
|
||||
&.edit-list .list-group-item {
|
||||
&.edit-list {
|
||||
.list-group-item {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
|
@ -271,6 +272,8 @@ body {
|
|||
.sort-icon {
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
opacity: 1;
|
||||
transition: opacity 100ms;
|
||||
cursor: grab;
|
||||
cursor: -webkit-grabbing;
|
||||
|
||||
|
@ -327,6 +330,12 @@ body {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.filtered .list-group-item .title-column .sort-icon {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit-item {
|
||||
|
|
Loading…
Reference in a new issue