X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b9a19ab23a8dc63bc7c7f867e2ece6924319f0f2..f1a4669c957d29c012466768581c4a801e5029be:/app/assets/javascripts/leaflet.share.js diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index 7449fb6d7..d43f99b1d 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -16,12 +16,9 @@ L.Control.Share = L.Control.extend({ link.href = '#'; link.title = this.options.title; - this._uiPane = L.DomUtil.create('div', 'leaflet-map-ui', map._container); + this._uiPane = this.options.uiPane; - L.DomEvent - .on(this._uiPane, 'click', L.DomEvent.stopPropagation) - .on(this._uiPane, 'click', L.DomEvent.preventDefault) - .on(this._uiPane, 'dblclick', L.DomEvent.preventDefault); + this._map = map; var h2 = L.DomUtil.create('h2', '', this._uiPane); h2.innerHTML = I18n.t('javascripts.share.title'); @@ -40,9 +37,9 @@ L.Control.Share = L.Control.extend({ }, _update: function (e) { - var center = map.getCenter().wrap(); - var layers = getMapLayers(); - this._linkInput.value = this.options.getUrl(map); + var center = this._map.getCenter().wrap(); + var layers = getMapLayers(this._map); + this._linkInput.value = this.options.getUrl(this._map); }, _toggle: function() {