akhodakivskiy/VimFx — pull request #244 by lydell (2013-12-30 11:15:58+00:00)
Title: Make button click depend on current mode. Fix #243

Both insert mode and disabled mode use the same greyed out icon for the
toolbar button. If you're in insert mode and click the button, we used to
disable the extension as normal. However, it felt like clicking the button
did nothing, because the icon didn't change. Even if it _would_ change, it
feels more natural if the extension is _enabled_ again at that point. So
now, if you're in insert mode and click the button, we enter normal mode.
(#243)

If the current site is blacklisted, clicking the button used to disable
the extension. Well, it was already disabled, but the button icon changed
from the blacklisted icon (red) to the disabled icon (grey). Clicking
again went back to blacklisted mode. That's pretty weird. Now we open the
menu popup when clicked instead, which will show the trash can icon which
is used to un-blacklist the site. Un-blacklisting directly when clicking
the button would be to go too far, since that can potentially remove more
blacklisting rules than the user wants to. Using the popup you have a
chance to review what will be removed when un-blacklisting.

To sum up, the button clicking is more intuitive now:

- If enabled: Disable
- Otherwise: Enable (almost)