ref(ConnectionIndicator.js) pass icon class as an argument

This commit is contained in:
paweldomas 2016-09-16 14:52:07 -05:00
parent b3d6e5876e
commit cf931f8a9f
1 changed files with 4 additions and 4 deletions

View File

@ -245,13 +245,13 @@ ConnectionIndicator.prototype.showMore = function () {
}; };
function createIcon(classes) { function createIcon(classes, iconClass) {
var icon = document.createElement("span"); var icon = document.createElement("span");
for(var i in classes) { for(var i in classes) {
icon.classList.add(classes[i]); icon.classList.add(classes[i]);
} }
icon.appendChild( icon.appendChild(
document.createElement("i")).classList.add("icon-connection"); document.createElement("i")).classList.add(iconClass);
return icon; return icon;
} }
@ -282,9 +282,9 @@ ConnectionIndicator.prototype.create = function () {
}.bind(this); }.bind(this);
this.emptyIcon = this.connectionIndicatorContainer.appendChild( this.emptyIcon = this.connectionIndicatorContainer.appendChild(
createIcon(["connection", "connection_empty"])); createIcon(["connection", "connection_empty"], "icon-connection"));
this.fullIcon = this.connectionIndicatorContainer.appendChild( this.fullIcon = this.connectionIndicatorContainer.appendChild(
createIcon(["connection", "connection_full"])); createIcon(["connection", "connection_full"], "icon-connection"));
}; };
/** /**