From a43c5466672d074135aa9b33c0a6ae2e29e8c63c Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Mon, 21 Jul 2014 14:38:26 +0200 Subject: [PATCH] =?UTF-8?q?Uncollapse=20when=20there=E2=80=99s=20only=20lo?= =?UTF-8?q?gos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/ol.css | 10 ++++++++++ src/ol/control/attributioncontrol.js | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/css/ol.css b/css/ol.css index e2714500f3..a76ab56407 100644 --- a/css/ol.css +++ b/css/ol.css @@ -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; } diff --git a/src/ol/control/attributioncontrol.js b/src/ol/control/attributioncontrol.js index d12e054404..f1fe7ae883 100644 --- a/src/ol/control/attributioncontrol.js +++ b/src/ol/control/attributioncontrol.js @@ -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);