From 6e84f0a2b5602b28c31821058ca30e1fb30d76ee Mon Sep 17 00:00:00 2001 From: Zakar Handricken Date: Sat, 15 Sep 2018 16:45:57 -0400 Subject: [PATCH] Set color of Alpha icon based on opacity value. --- src/js/controller/LayersListController.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/controller/LayersListController.js b/src/js/controller/LayersListController.js index 9ad1dc3..08f61a1 100644 --- a/src/js/controller/LayersListController.js +++ b/src/js/controller/LayersListController.js @@ -130,6 +130,14 @@ layerNameEl.setAttribute('title', layer.getName()); layerNameEl.setAttribute('rel', 'tooltip'); } + var opacity = layer.getOpacity(); + if (opacity == 1) { + layerItem.querySelector('.layer-item-opacity').style.color = '#ffd700'; + } else if (opacity == 0) { + layerItem.querySelector('.layer-item-opacity').style.color = '#969696'; + } else { + layerItem.querySelector('.layer-item-opacity').style.color = '#ffffff'; + } }; ns.LayersListController.prototype.onClick_ = function (evt) {