This commit is contained in:
Manuel Simon Hirsig
2016-08-02 03:45:28 +02:00
parent 09a674b725
commit e7c290dd5e
2 changed files with 12 additions and 3 deletions
+8 -1
View File
@@ -728,7 +728,7 @@ function private.initialize_filter_dropdown()
local function on_click()
UIDropDownMenu_SetSelectedValue(m.filter_dropdown, this.value)
m.filter_button:SetText(this.value)
if Aux.safe(Aux.filter.filters[this.value]).input_type/'' == '' then
if Aux.safe(Aux.filter.filters[this.value]).input_type/'' == '' and this.value ~= 'and' and this.value ~= 'or' then
m.filter_input:Hide()
else
local _, _, suggestions = Aux.filter.parse_query_string(UIDropDownMenu_GetSelectedValue(m.filter_dropdown)..'/')
@@ -861,6 +861,13 @@ function private.add_post_filter()
local name = UIDropDownMenu_GetSelectedValue(m.filter_dropdown)
if name then
local filter = name
if not Aux.filter.filters[name] and filter == 'and' or filter == 'or' then
if not tonumber(m.filter_input:GetText()) and m.filter_input:GetText() ~= '*' then
Aux.log('Invalid operator suffix')
return
end
filter = filter..m.filter_input:GetText()
end
if Aux.filter.filters[name] and Aux.filter.filters[name].input_type ~= '' then
filter = filter..'/'..m.filter_input:GetText()
end
+4 -2
View File
@@ -559,15 +559,17 @@ function public.indented_post_query_string(components)
suffix = component[3]
end
str = str..'|cffffff00'..component[2]..suffix..'|r'
tinsert(stack, component[3])
tinsert(stack, component[3] or '*')
elseif component[1] == 'filter' then
str = str..'|cffffff00'..component[2]..'|r'
if component[3] then
str = str..': '..'|cffff9218'..component[3]..'|r'
end
local top = tremove(stack)
if top and top > 1 then
if tonumber(top) and top > 1 then
tinsert(stack, top - 1)
elseif top == '*' then
tinsert(stack, top)
end
end
end