Merge branch 'stable' into gh-pages

This commit is contained in:
Vladimir Agafonkin 2012-08-01 14:20:23 +03:00
commit 0f68e16104
5 changed files with 68 additions and 17 deletions

View File

@ -7,6 +7,11 @@ Leaflet Changelog
An in-progress version being developed on the master branch.
## 0.4.2 (August 1, 2012)
* Fixed a bug where layers control radio buttons would not work correctly in IE7 (by [@danzel](https://github.com/danzel)). [#862](https://github.com/CloudMade/Leaflet/pull/862)
* Fixed a bug where `FeatureGroup` `removeLayer` would unbind popups of removed layers even if the popups were not put by the group (affected [Leaflet.markercluster](https://github.com/danzel/Leaflet.markercluster) plugin) (by [@danzel](https://github.com/danzel)). [#861](https://github.com/CloudMade/Leaflet/pull/861)
## 0.4.1 (July 31, 2012)
* Fixed a bug that caused marker shadows appear as opaque black in IE6-8. [#850](https://github.com/CloudMade/Leaflet/issues/850)

37
dist/leaflet-src.js vendored
View File

@ -3513,7 +3513,11 @@ L.FeatureGroup = L.LayerGroup.extend({
L.LayerGroup.prototype.removeLayer.call(this, layer);
if (this._popupContent) {
return this.invoke('unbindPopup');
} else {
return this;
}
},
bindPopup: function (content) {
@ -6925,16 +6929,35 @@ L.Control.Layers = L.Control.extend({
this._separator.style.display = (overlaysPresent && baseLayersPresent ? '' : 'none');
},
_addItem: function (obj, onclick) {
var label = document.createElement('label');
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
_createRadioElement: function (name, checked) {
var input = document.createElement('input');
if (!obj.overlay) {
input.name = 'leaflet-base-layers';
var radioHtml = '<input type="radio" name="' + name + '"';
if (checked) {
radioHtml += ' checked="checked"';
}
input.type = obj.overlay ? 'checkbox' : 'radio';
radioHtml += '/>';
var radioFragment = document.createElement('div');
radioFragment.innerHTML = radioHtml;
return radioFragment.firstChild;
},
_addItem: function (obj) {
var label = document.createElement('label'),
input,
checked = this._map.hasLayer(obj.layer);
if (obj.overlay) {
input = document.createElement('input');
input.type = 'checkbox';
input.defaultChecked = checked;
} else {
input = this._createRadioElement('leaflet-base-layers', checked);
}
input.layerId = L.Util.stamp(obj.layer);
input.defaultChecked = this._map.hasLayer(obj.layer);
L.DomEvent.on(input, 'click', this._onInputClick, this);

2
dist/leaflet.js vendored

File diff suppressed because one or more lines are too long

View File

@ -133,16 +133,35 @@ L.Control.Layers = L.Control.extend({
this._separator.style.display = (overlaysPresent && baseLayersPresent ? '' : 'none');
},
_addItem: function (obj, onclick) {
var label = document.createElement('label');
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
_createRadioElement: function (name, checked) {
var input = document.createElement('input');
if (!obj.overlay) {
input.name = 'leaflet-base-layers';
var radioHtml = '<input type="radio" name="' + name + '"';
if (checked) {
radioHtml += ' checked="checked"';
}
input.type = obj.overlay ? 'checkbox' : 'radio';
radioHtml += '/>';
var radioFragment = document.createElement('div');
radioFragment.innerHTML = radioHtml;
return radioFragment.firstChild;
},
_addItem: function (obj) {
var label = document.createElement('label'),
input,
checked = this._map.hasLayer(obj.layer);
if (obj.overlay) {
input = document.createElement('input');
input.type = 'checkbox';
input.defaultChecked = checked;
} else {
input = this._createRadioElement('leaflet-base-layers', checked);
}
input.layerId = L.Util.stamp(obj.layer);
input.defaultChecked = this._map.hasLayer(obj.layer);
L.DomEvent.on(input, 'click', this._onInputClick, this);

View File

@ -26,7 +26,11 @@ L.FeatureGroup = L.LayerGroup.extend({
L.LayerGroup.prototype.removeLayer.call(this, layer);
if (this._popupContent) {
return this.invoke('unbindPopup');
} else {
return this;
}
},
bindPopup: function (content) {