diff --git a/leaflet.rrose.css b/leaflet.rrose.css index 0b178d2..340be5f 100644 --- a/leaflet.rrose.css +++ b/leaflet.rrose.css @@ -84,6 +84,12 @@ a.leaflet-rrose-close-button:hover { color: #999; } +a.leaflet-rrose-close-button-s, +a.leaflet-rrose-close-button-se, +a.leaflet-rrose-close-button-sw { + top: 20px; +} + .leaflet-rrose-content p { margin: 18px 0; } diff --git a/rrose-src.js b/rrose-src.js index a1d1cde..de2de8e 100644 --- a/rrose-src.js +++ b/rrose-src.js @@ -98,6 +98,7 @@ L.Rrose = L.Popup.extend({ L.DomEvent.on(this._contentNode, 'mousewheel', L.DomEvent.stopPropagation); this._tip = L.DomUtil.create('div', prefix + '-tip' + ' ' + prefix + '-tip-' + newPosition, this._tipContainer); } + L.DomUtil.addClass(closeButton, prefix + '-close-button-' + newPosition); this.options.position = newPosition; } else if (currentPosition != newPosition) { @@ -108,6 +109,8 @@ L.Rrose = L.Popup.extend({ L.DomUtil.addClass(this._tipContainer, prefix + '-tip-container-' + newPosition); L.DomUtil.removeClass(this._tip, prefix + '-tip-' + currentPosition); L.DomUtil.addClass(this._tip, prefix + '-tip-' + newPosition); + L.DomUtil.removeClass(closeButton, prefix + '-close-button-' + currentPosition); + L.DomUtil.addClass(closeButton, prefix + '-close-button-' + newPosition); // Swap DOM elements to keep correct order if (/n/.test(currentPosition) && /s/.test(newPosition)) { this._wrapper.parentNode.insertBefore(this._tipContainer, this._wrapper);