diff --git a/tabs/search/core.lua b/tabs/search/core.lua index 9cd21b3..697c7ff 100644 --- a/tabs/search/core.lua +++ b/tabs/search/core.lua @@ -875,3 +875,8 @@ function private.add_post_filter() end end +function private.remove_post_filter() + tremove(m.post_components) + m.filter_display:SetText(Aux.filter.indented_post_query_string(m.post_components)) +end + diff --git a/tabs/search/frames.lua b/tabs/search/frames.lua index c599fb4..01dd62d 100644 --- a/tabs/search/frames.lua +++ b/tabs/search/frames.lua @@ -526,7 +526,14 @@ Aux.search_tab.FRAMES(function(m, public, private) btn:SetWidth(170) btn:SetHeight(25) btn:SetPoint('CENTER', m.filter_dropdown, 'CENTER', 0, 0) - btn:SetScript('OnClick', m.add_post_filter) + btn:RegisterForClicks('LeftButtonUp', 'RightButtonUp') + btn:SetScript('OnClick', function() + if arg1 == 'LeftButton' then + m.add_post_filter() + elseif arg1 == 'RightButton' then + m.remove_post_filter() + end + end) private.filter_button = btn end do @@ -541,6 +548,7 @@ Aux.search_tab.FRAMES(function(m, public, private) -- Aux.completion.complete(this, function() return filter and ({filter.validator()})[3] or {} end) end) input:SetScript('OnEnterPressed', m.add_post_filter) + input:Hide() private.filter_input = input end do