Skip to content

Commit

Permalink
ensure that _reorderUp and _reoderDown dom nodes exist before cal…
Browse files Browse the repository at this point in the history
…ling set methods.
  • Loading branch information
tmcgee committed Jul 8, 2016
1 parent b189f5c commit a3f09e3
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions viewer/js/gis/dijit/LayerControl.js
Original file line number Diff line number Diff line change
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 a3f09e3

Please sign in to comment.