The first thing that the setState() function does is to remove the 'on' and 'off'
classes for the state that it is dealing with.
This is as a precursor to setting the correct state, but is wasteful in the
situation where the class is already present (when enabling) or already absent
(when disabling).
It would be better to only remove the 'off' class when enabling, and remove
the 'on' class when disabling, and further, to check whether the class is
present.
Imported from backplanejs Google Code issue 47.
The first thing that the setState() function does is to remove the 'on' and 'off' classes for the state that it is dealing with.
This is as a precursor to setting the correct state, but is wasteful in the situation where the class is already present (when enabling) or already absent (when disabling).
It would be better to only remove the 'off' class when enabling, and remove the 'on' class when disabling, and further, to check whether the class is present.
Owner set to markbirbeck
Priority: Medium Type: Enhancement