Uncollapse when there’s only logos

This commit is contained in:
Antoine Abt
2014-07-21 14:38:26 +02:00
parent a71714e8b6
commit a43c546667
2 changed files with 16 additions and 0 deletions

View File

@@ -219,6 +219,9 @@ button.ol-full-screen-true:after {
.ol-attribution.ol-collapsed ul {
display: none;
}
.ol-attribution.ol-logo-only ul {
display: block;
}
.ol-attribution:not(.ol-collapsed) {
background: rgba(255,255,255,0.8);
}
@@ -229,10 +232,17 @@ button.ol-full-screen-true:after {
height: 1.1em;
line-height: 1em;
}
.ol-attribution.ol-logo-only {
background: transparent;
bottom: .4em;
height: 1.1em;
line-height: 1em;
}
.ol-attribution.ol-uncollapsible img {
margin-top: -.2em;
max-height: 1.6em;
}
.ol-attribution.ol-logo-only button,
.ol-attribution.ol-uncollapsible button {
display: none;
}

View File

@@ -272,6 +272,12 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
goog.style.setElementShown(this.element, renderVisible);
this.renderedVisible_ = renderVisible;
}
if (renderVisible &&
goog.object.isEmpty(this.attributionElementRenderedVisible_)) {
goog.dom.classlist.add(this.element, 'ol-logo-only');
} else {
goog.dom.classlist.remove(this.element, 'ol-logo-only');
}
this.insertLogos_(frameState);