Merge pull request #8187 from tschaub/hide-attribution
Hide attribution control if there are no attributions
This commit is contained in:
@@ -231,6 +231,13 @@ Attribution.prototype.updateElement_ = function(frameState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const attributions = this.getSourceAttributions_(frameState);
|
const attributions = this.getSourceAttributions_(frameState);
|
||||||
|
|
||||||
|
const visible = attributions.length > 0;
|
||||||
|
if (this.renderedVisible_ != visible) {
|
||||||
|
this.element.style.display = visible ? '' : 'none';
|
||||||
|
this.renderedVisible_ = visible;
|
||||||
|
}
|
||||||
|
|
||||||
if (equals(attributions, this.renderedAttributions_)) {
|
if (equals(attributions, this.renderedAttributions_)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -244,13 +251,6 @@ Attribution.prototype.updateElement_ = function(frameState) {
|
|||||||
this.ulElement_.appendChild(element);
|
this.ulElement_.appendChild(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const visible = attributions.length > 0;
|
|
||||||
if (this.renderedVisible_ != visible) {
|
|
||||||
this.element.style.display = visible ? '' : 'none';
|
|
||||||
this.renderedVisible_ = visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.renderedAttributions_ = attributions;
|
this.renderedAttributions_ = attributions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user