Permalink
Browse files

Once more, with feeling...

  • Loading branch information...
IDisposable committed Jun 12, 2012
1 parent 403ca63 commit 31fa58e31e697fee8d2d7888c3253d0d38240f8b
Showing with 6 additions and 1 deletion.
  1. +6 −1 socialite.js
View
@@ -19,6 +19,11 @@ window.Socialite = (function(window, document, undefined)
settings: { },
+ trim: function(str)
+ {
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,'');
+ },
+
hasClass: function(el, cn)
{
return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;
@@ -33,7 +38,7 @@ window.Socialite = (function(window, document, undefined)
removeClass: function(el, cn)
{
- el.className = (' ' + el.className + ' ').replace(' ' + cn + ' ', ' ');
+ el.className = socialite.trim(' ' + el.className + ' '.replace(' ' + cn + ' ', ' '));
},
/**

0 comments on commit 31fa58e

Please sign in to comment.