Use setElementShown instead of showElement

This commit is contained in:
Tom Payne
2013-07-22 17:09:54 +02:00
parent 0467222e46
commit 46d16ba0ca
8 changed files with 20 additions and 19 deletions

View File

@@ -126,7 +126,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
if (goog.isNull(frameState)) {
if (this.renderedVisible_) {
goog.style.showElement(this.element, false);
goog.style.setElementShown(this.element, false);
this.renderedVisible_ = false;
}
return;
@@ -142,14 +142,15 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
for (attributionKey in this.attributionElements_) {
if (attributionKey in visibleAttributions) {
if (!this.attributionElementRenderedVisible_[attributionKey]) {
goog.style.showElement(this.attributionElements_[attributionKey], true);
goog.style.setElementShown(
this.attributionElements_[attributionKey], true);
this.attributionElementRenderedVisible_[attributionKey] = true;
}
delete visibleAttributions[attributionKey];
}
else if (attributionKey in hiddenAttributions) {
if (this.attributionElementRenderedVisible_[attributionKey]) {
goog.style.showElement(
goog.style.setElementShown(
this.attributionElements_[attributionKey], false);
delete this.attributionElementRenderedVisible_[attributionKey];
}
@@ -173,7 +174,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
attributionElement = goog.dom.createElement(goog.dom.TagName.LI);
attributionElement.innerHTML =
hiddenAttributions[attributionKey].getHTML();
goog.style.showElement(attributionElement, false);
goog.style.setElementShown(attributionElement, false);
goog.dom.appendChild(this.ulElement_, attributionElement);
this.attributionElements_[attributionKey] = attributionElement;
}
@@ -181,7 +182,7 @@ ol.control.Attribution.prototype.updateElement_ = function(frameState) {
var renderVisible =
!goog.object.isEmpty(this.attributionElementRenderedVisible_);
if (this.renderedVisible_ != renderVisible) {
goog.style.showElement(this.element, renderVisible);
goog.style.setElementShown(this.element, renderVisible);
this.renderedVisible_ = renderVisible;
}

View File

@@ -73,7 +73,7 @@ ol.control.Logo.prototype.updateElement_ = function(frameState) {
if (goog.isNull(frameState)) {
if (this.renderedVisible_) {
goog.style.showElement(this.element, false);
goog.style.setElementShown(this.element, false);
this.renderedVisible_ = false;
}
return;
@@ -104,7 +104,7 @@ ol.control.Logo.prototype.updateElement_ = function(frameState) {
var renderVisible = !goog.object.isEmpty(logos);
if (this.renderedVisible_ != renderVisible) {
goog.style.showElement(this.element, renderVisible);
goog.style.setElementShown(this.element, renderVisible);
this.renderedVisible_ = renderVisible;
}

View File

@@ -194,7 +194,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
if (goog.isNull(view2DState)) {
if (this.renderedVisible_) {
goog.style.showElement(this.element_, false);
goog.style.setElementShown(this.element_, false);
this.renderedVisible_ = false;
}
return;
@@ -322,7 +322,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
}
if (!this.renderedVisible_) {
goog.style.showElement(this.element_, true);
goog.style.setElementShown(this.element_, true);
this.renderedVisible_ = true;
}