Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor for non-destructive style attribute logic in Update() method. …
…Fixes #18
- Loading branch information
Julian Lloyd
committed
Feb 28, 2014
1 parent
079144e
commit 7354d66
Showing
3 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The problem is here for issue #23
I failed to capture the starting style attribute once, but instead, captured it every time the update function was called—naturally, this resulted in unreliable (and just wrong) starting styles.
My solution is to create an array on the parent object, called
styleBank
which holds the original style attribute value—and only sets once:The rest of the code more or less stays the same.