this.pinned = pin != null && pin gave wrong results when no parameter was given, see http://jsfiddle.net/RiZKiT/dAcjF/3/ for two correct alternatives.
this.pinned = pin != null && pin
But I removed it because we can get the pinned status from the element storage, so you always have the correct value even if another script changed the pin status. If you don't like that solution, then you should fix this.pinned.
Removed buggy this.pinned