sidewinderlabs / backplanejs

Other
12 stars 3 forks source link

Only toggle classes in setState() if the state is actually changing #47

Closed backplane-import closed 13 years ago

backplane-import commented 13 years ago

Imported from backplanejs Google Code issue 47.

Reporter markbirbeck
Date 24 Apr 2010 5:02:33 PM UTC

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

backplane-import commented 13 years ago

Comment by markbirbeck on 24 Apr 2010 5:42:01 PM UTC

This issue was closed by revision 61c50ad3b25830ff686fbbdf000ae39ac53a1bda (originally d6ea4e794d).


Updates

Ticket status set to Fixed