Skip to content

Commit

Permalink
Merge pull request #568 from cmv/fix/minor-layerControl-fixes
Browse files Browse the repository at this point in the history
Minor fixes to layerControl widget
  • Loading branch information
DavidSpriggs authored Jul 11, 2016
2 parents 29b53f0 + 4239faa commit 53ef38e
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions viewer/js/gis/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ define([
if (layer.loaded) {
this._applyLayerControlOptions(layerInfo.controlOptions, layer);
} else {
layer.on('load', lang.hitch(this, '_applyLayerControlOptions', layer.controlOptions));
layer.on('load', lang.hitch(this, '_applyLayerControlOptions', layerInfo.controlOptions));
}
}
var layerControl = new Control({
Expand Down Expand Up @@ -346,29 +346,37 @@ define([
if (this.separated) {
if (this.vectorReorder) {
array.forEach(this._vectorContainer.getChildren(), function (child) {
if (!child.getPreviousSibling()) {
child._reorderUp.set('disabled', true);
} else {
child._reorderUp.set('disabled', false);
if (child._reorderUp) {
if (!child.getPreviousSibling()) {
child._reorderUp.set('disabled', true);
} else {
child._reorderUp.set('disabled', false);
}
}
if (!child.getNextSibling()) {
child._reorderDown.set('disabled', true);
} else {
child._reorderDown.set('disabled', false);
if (child._reorderDown) {
if (!child.getNextSibling()) {
child._reorderDown.set('disabled', true);
} else {
child._reorderDown.set('disabled', false);
}
}
}, this);
}
if (this.overlayReorder) {
array.forEach(this._overlayContainer.getChildren(), function (child) {
if (!child.getPreviousSibling()) {
child._reorderUp.set('disabled', true);
} else {
child._reorderUp.set('disabled', false);
if (child._reorderUp) {
if (!child.getPreviousSibling()) {
child._reorderUp.set('disabled', true);
} else {
child._reorderUp.set('disabled', false);
}
}
if (!child.getNextSibling()) {
child._reorderDown.set('disabled', true);
} else {
child._reorderDown.set('disabled', false);
if (child._reorderDown) {
if (!child.getNextSibling()) {
child._reorderDown.set('disabled', true);
} else {
child._reorderDown.set('disabled', false);
}
}
}, this);
}
Expand Down

0 comments on commit 53ef38e

Please sign in to comment.