Created
August 30, 2011 18:58
-
-
Save lukemelia/1181708 to your computer and use it in GitHub Desktop.
classNameBindings patch
This file contains hidden or 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
diff --git a/frameworks/core_foundation/views/view.js b/frameworks/core_foundation/views/view.js | |
index 9232a48..9384422 100644 | |
--- a/frameworks/core_foundation/views/view.js | |
+++ b/frameworks/core_foundation/views/view.js | |
@@ -725,12 +725,14 @@ SC.CoreView.reopen( | |
// If we had previously added a class to the element, remove it. | |
if (oldClass) { | |
elem.removeClass(oldClass); | |
+ classNames.removeObject(newClass); | |
} | |
// If necessary, add a new class. Make sure we keep track of it so | |
// it can be removed in the future. | |
if (newClass) { | |
elem.addClass(newClass); | |
+ classNames.push(newClass); | |
oldClass = newClass; | |
} else { | |
oldClass = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment