Permalink
Browse files

Add removeFrom to make map.removeControl work

  • Loading branch information...
tmcw committed Oct 5, 2013
1 parent 2316425 commit 431bff5c654a8e2fa2ed0f3dd4dc8560a20697a9
Showing with 3 additions and 3 deletions.
  1. +2 −2 leaflet-hash.js
  2. +1 −1 test/spec/hash.js
View
@@ -65,7 +65,7 @@
}
},
remove: function() {
removeFrom: function(map) {
if (this.changeTimeout) {
clearTimeout(this.changeTimeout);
}
@@ -157,6 +157,6 @@
this._hash = L.hash(this);
};
L.Map.prototype.removeHash = function() {
this._hash.remove();
this._hash.removeFrom();
};
})(window);
View
@@ -49,7 +49,7 @@ describe("L.Hash", function() {
it('unbinds events when removed', function() {
location.hash = '';
var hash = L.hash(map);
hash.remove();
map.removeControl(hash);
map.setView([51.505, -0.09], 13);
expect(location.hash).to.be('');
});

0 comments on commit 431bff5

Please sign in to comment.