Skip to content

Commit

Permalink
fix(layer-selector-ui): layer is correctly set to invisible when its …
Browse files Browse the repository at this point in the history
…opacity set to 0

Closes #9616
  • Loading branch information
AleksueiR committed Apr 28, 2015
1 parent d44d085 commit d1bc831
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/js/RAMP/Modules/filterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ define([
// Setting Opacity to >0.0, sets layer to visible
newState = leftValue === 0 ? false : slider.hasClass("disabled") ? true : newState;

if (newState && cause && cause !== "refresh") {
// TODO: refactor; this is a bit unclear
// fire event only if newState is false or true; do nothing if undefined
if (typeof newState !== 'undefined' && cause && cause !== "refresh") {
topic.publish(EventManager.FilterManager.TOGGLE_LAYER_VISIBILITY, {
state: newState,
layerId: sliderId
Expand Down
9 changes: 6 additions & 3 deletions src/js/RAMP/Utils/checkboxGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ define(["dojo/Evented", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/arr
nodes: nodes
}
);

masterCheckboxOptions = {
nodeIdAttr: this.nodeIdAttr,
cssClass: this.cssClass,
label: this.label,
onChange: this.onChange
};

if (this.master.node) {
this.master.checkbox = new Checkbox(
this.master.node,
Expand Down Expand Up @@ -312,7 +312,10 @@ define(["dojo/Evented", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/arr
}
}

checkbox.setState(state);
// make sure there is a checkbox to set state on
if (checkbox) {
checkbox.setState(state);
}

this._checkMaster();
}
Expand Down

0 comments on commit d1bc831

Please sign in to comment.