Fix the behavior of "optional" filter and the buttons near it

Several things related to the filtering menu:
* Fix the events so that the right events apply to
  right items.
* Add a proper message for the check box.
* Add a data-filter attribute to the check box.

Change-Id: I9f7a6a05bd12519f3ceba1e2c4502896097b141d
Merge "Fix the behavior of "optional" filter and the buttons near it"