From ae1c6f4039d917e4860b157c3e2a41a6f7b192d4 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 9 Dec 2016 19:41:57 +0100 Subject: [PATCH] refactoring --- tabs/search/filter.lua | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tabs/search/filter.lua b/tabs/search/filter.lua index 97f29d3..4aaaf65 100644 --- a/tabs/search/filter.lua +++ b/tabs/search/filter.lua @@ -80,25 +80,22 @@ function update_form() end if blizzard_query.exact then + usable_checkbox:Disable() + for key in temp-S('min_level', 'max_level') do + _M[key .. '_input']:EnableMouse(false) + _M[key .. '_input']:ClearFocus() + end for key in temp-S('class', 'subclass', 'slot', 'quality') do _M[key .. '_dropdown'].button:Disable() end - else - class_dropdown.button:Enable() - quality_dropdown.button:Enable() - end - for key in temp-S('min_level', 'max_level') do - if blizzard_query.exact then - _M[key .. '_input']:EnableMouse(false) - _M[key .. '_input']:ClearFocus() - else - _M[key .. '_input']:EnableMouse(true) - end - end - if blizzard_query.exact then - usable_checkbox:Disable() + CloseDropDownMenus() else usable_checkbox:Enable() + for key in temp-S('min_level', 'max_level') do + _M[key .. '_input']:EnableMouse(true) + end + class_dropdown.button:Enable() + quality_dropdown.button:Enable() end if any(temp-A('min_level', 'max_level', 'usable', 'class', 'subclass', 'slot', 'quality'), function(key) return blizzard_query[key] end) then