Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Use a ternary operator to reduce duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Feb 28, 2012
1 parent 64d9bd0 commit b1fa915
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions extension/data/widget/widget.js
Expand Up @@ -52,12 +52,7 @@ self.port.on("update_memory", function(data) {
});

logger.onclick = function toggle() {
if (logger.className === "enabled") {
logger.className = "disabled";
}
else {
logger.className = "enabled";
}
logger.className = logger.className === "enabled" ? "disabled" : "enabled";
self.port.emit("logging_changed");
};

Expand Down

0 comments on commit b1fa915

Please sign in to comment.