CloudMade/Leaflet — pull request #433 by aceiii (2012-01-13 21:07:38+00:00)
Title: Attribution control only works after it's added to map.

Creating an Attribution control and setting its prefix or adding attributions before the control is added to a map causes an error to occur and the prefix and attributions are reset when the control is added to the map.

var attrib = new L.Control.Attribution;
attrib.setPrefix( "My Prefix" );
attrib.addAttribution( "Copyright © 2012 Ace III" ); //error

map.addControl( attrib ); //prefix and attributions reset whenever control is added