mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Scene list toolbar (#5938)
* Add sticky query toolbar to scenes page * Filter button accept count instead of filter * Add play button * Add create button functionality. Remove new scene button from navbar * Separate toolbar into component * Separate sort by select component * Don't show filter tags control if no criteria * Add utility setter methods to ListFilterModel * Add results header with display options * Use css for filter tag styling * Add className to OperationDropdown and Item * Increase size of sidebar controls on mobile
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { CriterionOption } from "./criteria/criterion";
|
||||
import { DisplayMode } from "./types";
|
||||
|
||||
interface ISortByOption {
|
||||
export interface ISortByOption {
|
||||
messageID: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
@@ -521,6 +521,34 @@ export class ListFilterModel {
|
||||
public setPageSize(pageSize: number) {
|
||||
const ret = this.clone();
|
||||
ret.itemsPerPage = pageSize;
|
||||
ret.currentPage = 1; // reset to first page
|
||||
return ret;
|
||||
}
|
||||
|
||||
public setSortBy(sortBy: string | undefined) {
|
||||
const ret = this.clone();
|
||||
ret.sortBy = sortBy;
|
||||
ret.currentPage = 1; // reset to first page
|
||||
return ret;
|
||||
}
|
||||
|
||||
public toggleSortDirection() {
|
||||
const ret = this.clone();
|
||||
|
||||
if (ret.sortDirection === SortDirectionEnum.Asc) {
|
||||
ret.sortDirection = SortDirectionEnum.Desc;
|
||||
} else {
|
||||
ret.sortDirection = SortDirectionEnum.Asc;
|
||||
}
|
||||
|
||||
ret.currentPage = 1; // reset to first page
|
||||
return ret;
|
||||
}
|
||||
|
||||
public reshuffleRandomSort() {
|
||||
const ret = this.clone();
|
||||
ret.currentPage = 1;
|
||||
ret.randomSeed = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user