Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Once more, with feeling...

  • Loading branch information...
commit 31fa58e31e697fee8d2d7888c3253d0d38240f8b 1 parent 403ca63
@IDisposable IDisposable authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 socialite.js
View
7 socialite.js
@@ -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 + ' ', ' '));
},
/**
Please sign in to comment.
Something went wrong with that request. Please try again.