From e0c40481e708e26ae69b58a9afb2edbc367d25b6 Mon Sep 17 00:00:00 2001 From: Benjamin King Date: Wed, 8 Nov 2017 14:05:31 -0500 Subject: [PATCH] update active layers when layer is added to removed #601 --- web/js/layers/wv.layers.modal.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/js/layers/wv.layers.modal.js b/web/js/layers/wv.layers.modal.js index c9aa2572d9..8367056a84 100644 --- a/web/js/layers/wv.layers.modal.js +++ b/web/js/layers/wv.layers.modal.js @@ -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() {