From babf16282b46781ebf3eb654c6f0d83089f62f9a Mon Sep 17 00:00:00 2001 From: Sebastian Herber Date: Sun, 29 Nov 2015 00:01:17 +0100 Subject: [PATCH] Reworks unused display var to set visibility class replaces this.class instance variable as it looks like it is not used anywhere else --- src/share-button.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/share-button.js b/src/share-button.js index a83c8ad..aa90914 100644 --- a/src/share-button.js +++ b/src/share-button.js @@ -729,7 +729,8 @@ class ShareButton extends ShareUtils { _detectNetworks() { // Update network-specific configuration with global configurations for (let network of Object.keys(this.config.networks)) { - let display; + let displayClass = 'disabled'; + for (let option of Object.keys(this.config.networks[network])) { if (this.config.networks[network][option] === null) { this.config.networks[network][option] = this.config[option]; @@ -738,13 +739,11 @@ class ShareButton extends ShareUtils { // Check for enabled networks and display them if (this.config.networks[network].enabled) { - this.class = 'enabled'; + displayClass = 'enabled'; this.config.enabledNetworks += 1; } - else - this.class = 'disabled'; - this.config.networks[network].class = this.class; + this.config.networks[network].class = displayClass; } }