[Rails] Bugfix for removeClassName in prototype.js 1.4.0_rc2
Not sure where the tracker for Prototype is, so I’m posting it here, in case fellow railers run into it—1.4.0_rc2 is the version distributed with the latest Rails.
Element.removeClassName will leave the classnames with commas instead of space between classes. Fortunately, the fix is easy:
Index: public/javascripts/prototype.js
===================================================================
--- public/javascripts/prototype.js (revision 450)
+++ public/javascripts/prototype.js (working copy)
@@ -1079,7 +1079,7 @@
if (!this.include(classNameToRemove)) return;
this.set(this.select(function(className) {
return className != classNameToRemove;
- }));
+ }).join(' '));
},
toString: function() {
About Calvin Correli
I've spent the last 17 years learning, growing, healing, and discovering who I truly am, so that I'm now living every day aligned with my life's purpose.
0 comments
Leave a comment