mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
This commit is contained in:
parent
462469c490
commit
6e590f2733
3 changed files with 8 additions and 2 deletions
|
|
@ -805,7 +805,9 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||
return true;
|
||||
}
|
||||
});
|
||||
let empty = false;
|
||||
if (!filter) {
|
||||
empty = true;
|
||||
filter = {
|
||||
column: colId,
|
||||
operator: getDefaultOperatorByType(type),
|
||||
|
|
@ -814,6 +816,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
|
|||
avData.view.filters.push(filter);
|
||||
}
|
||||
setFilter({
|
||||
empty,
|
||||
filter,
|
||||
protyle,
|
||||
data: avData,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ export const setFilter = async (options: {
|
|||
protyle: IProtyle,
|
||||
data: IAV,
|
||||
target: HTMLElement,
|
||||
blockElement: Element
|
||||
blockElement: Element,
|
||||
empty: boolean
|
||||
}) => {
|
||||
let rectTarget = options.target.getBoundingClientRect();
|
||||
if (rectTarget.height === 0) {
|
||||
|
|
@ -175,7 +176,7 @@ export const setFilter = async (options: {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
if (isSame || !hasMatch) {
|
||||
if (!options.empty && (isSame || !hasMatch)) {
|
||||
return;
|
||||
}
|
||||
transaction(options.protyle, [{
|
||||
|
|
@ -598,6 +599,7 @@ export const addFilter = (options: {
|
|||
setPosition(options.menuElement, options.tabRect.right - options.menuElement.clientWidth, options.tabRect.bottom, options.tabRect.height);
|
||||
const filterElement = options.menuElement.querySelector(`[data-id="${column.id}"] .b3-chip`) as HTMLElement;
|
||||
setFilter({
|
||||
empty: true,
|
||||
filter,
|
||||
protyle: options.protyle,
|
||||
data: options.data,
|
||||
|
|
|
|||
|
|
@ -754,6 +754,7 @@ export const openMenuPanel = (options: {
|
|||
data.view.filters.find((item: IAVFilter) => {
|
||||
if (item.column === target.parentElement.parentElement.dataset.id && item.value.type === target.parentElement.parentElement.dataset.filterType) {
|
||||
setFilter({
|
||||
empty: false,
|
||||
filter: item,
|
||||
protyle: options.protyle,
|
||||
data,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue