Skip to content

Commit

Permalink
Merge branch 'develop' into feature/update-grunt-packages-and-eslint-…
Browse files Browse the repository at this point in the history
…rules
  • Loading branch information
tmcgee committed Apr 11, 2016
2 parents 991234e + 0322700 commit 425afa4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions viewer/js/gis/dijit/LayerControl/controls/_Control.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define([
'dojo/_base/declare',
'dojo/_base/lang',
//'dojo/_base/array',
'dojo/_base/array',
'dojo/on',
'dojo/topic',
'dojo/dom-construct',
Expand All @@ -15,7 +15,7 @@ define([
], function (
declare,
lang,
//array,
array,
on,
topic,
domConst,
Expand Down Expand Up @@ -193,11 +193,23 @@ define([
_scaleRangeChange: function () {
if (this.layer.minScale !== 0 || this.layer.maxScale !== 0) {
this._checkboxScaleRange();
if (this._scaleRangeHandler) {
var handlerIndex = array.indexOf(this._handlers, this._scaleRangeHandler);
if (handlerIndex !== -1) {
this._handlers[handlerIndex].remove();
this._handlers.splice(handlerIndex, 1);
}
}
this._scaleRangeHandler = this.layer.getMap().on('zoom-end', lang.hitch(this, '_checkboxScaleRange'));
this._handlers.push(this._scaleRangeHandler);
} else {
this._checkboxScaleRange();
if (this._scaleRangeHandler) {
this._scaleRangeHandler.remove();
var handlerIndex2 = array.indexOf(this._handlers, this._scaleRangeHandler);
if (handlerIndex2 !== -1) {
this._handlers[handlerIndex2].remove();
this._handlers.splice(handlerIndex2, 1);
}
this._scaleRangeHandler = null;
}
}
Expand Down

0 comments on commit 425afa4

Please sign in to comment.