Skip to content

Instantly share code, notes, and snippets.

@lukemelia
Created August 30, 2011 18:58
Show Gist options
  • Save lukemelia/1181708 to your computer and use it in GitHub Desktop.
Save lukemelia/1181708 to your computer and use it in GitHub Desktop.
classNameBindings patch
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