simplify event target check
optimize popup state check
fix useless trying to change mode when global findbar turns off