Skip to content

Commit

Permalink
Merge pull request #605 from nasa-gibs/layer-modal-bug-fix
Browse files Browse the repository at this point in the history
update active layers when layer is added or removed
  • Loading branch information
Benjaki2 authored Nov 8, 2017
2 parents 0380335 + e0c4048 commit 5d2f885
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/js/layers/wv.layers.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,21 @@ wv.layers.modal = wv.layers.modal || function(models, ui, config) {
var onLayerAdded = function(layer) {
var $element = $(self.selector + " [data-layer='" + wv.util.jqueryEscape(layer.id) + "']");
$element.iCheck("check");
if(self.reactList) {
self.reactList.setState({
activeLayers: model.active
});
}
};

var onLayerRemoved = function(layer) {
var $element = $(self.selector + " [data-layer='" + wv.util.jqueryEscape(layer.id) + "']");
$element.iCheck("uncheck");
if(self.reactList) {
self.reactList.setState({
activeLayers: model.active
});
}
};

var unfocusInput = function() {
Expand Down

0 comments on commit 5d2f885

Please sign in to comment.