Skip to content

Commit

Permalink
Add position class name for close button
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleepwalker committed Jun 22, 2015
1 parent 6a36096 commit 1c03634
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions leaflet.rrose.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions rrose-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 1c03634

Please sign in to comment.