namespace handling improvements, spec for noConflict

This commit is contained in:
mourner
2010-09-03 19:49:32 +03:00
parent 9d4e335fe0
commit ada607fa2f
3 changed files with 35 additions and 9 deletions

View File

@ -1,11 +1,16 @@
/*
* Leaflet namespace config, allows using any global variable instead of L
* Leaflet namespace config, allows using any global variable instead of L & restoring the original value
*/
var originalL = window.L,
L = {};
L.noConflict = function() {
window.L = originalL;
return this;
};
(function() {
var originalL = window.L;
L = {
version: '0.0.1'
};
L.noConflict = function() {
window.L = originalL;
return this;
};
})();