Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added disabled btn & styled. Optimize output if description available

ZachTRice8506790de6e8
diff --git a/web/css/wv.layers.info.css b/web/css/wv.layers.info.css
index cd4f069d9..1b070c4f0 100644
--- a/web/css/wv.layers.info.css
+++ b/web/css/wv.layers.info.css
@@ -10,9 +10,22 @@
*/
.bank li.item a.wv-layers-info {
- color: #000;
+ color: #333;
+}
+
+.bank li.item a.wv-layers-info.disabled {
+ color: #aaa;
+}
+
+.bank li.item a.wv-layers-info.disabled:hover {
+ cursor: no-drop;
+ background-color: transparent;
}
.bank li.layer-hidden a.wv-layers-info {
color: #999;
}
+
+.bank li.layer-hidden a.wv-layers-info.disabled {
+ color: #666;
+}
diff --git a/web/js/layers/wv.layers.active.js b/web/js/layers/wv.layers.active.js
index 1dc4447c9..85ebb9bbf 100644
--- a/web/js/layers/wv.layers.active.js
+++ b/web/js/layers/wv.layers.active.js
@@ -209,7 +209,13 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {
.attr("data-layer", layer.id)
.attr("title", "Layer description for " + names.title)
.addClass("wv-layers-info");
- $infoButton.on('click', toggleInfoPanel);
+ if(layer.description.length < 1) {
+ $infoButton
+ .addClass("disabled")
+ .attr("title", "No layer description");
+ } else {
+ $infoButton.on('click', toggleInfoPanel);
+ }
if ( wv.util.browser.small ) {
$infoButton.hide();
}
@@ -248,17 +254,7 @@ wv.layers.active = wv.layers.active || function(models, ui, config) {
.classed('data-bar-hovered',false);
});
- // Only output a info button if there is a description.
- _.each(config.measurements, function( measurement, measurementKey ) {
- _.each(measurement.sources, function( source, sourceKey ) {
- _.each(source.settings, function( setting, settingKey ) {
- if(layer.id == setting && source.description.length > 1) {
- $mainLayerDiv.prepend($infoButton);
- }
- });
- });
- });
-
+ $mainLayerDiv.prepend($infoButton);
$mainLayerDiv.prepend($editButton);
$mainLayerDiv.prepend($removeButton);
$layer.append($mainLayerDiv);