Skip to content

Commit

Permalink
setAllItemsEnabled is called before rangeslider is setUp
Browse files Browse the repository at this point in the history
call setAllItemsEnabled again after rangeslider is setup
  • Loading branch information
lc-thomasberger committed May 24, 2016
1 parent e46a6cb commit 4400fd1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/adapt-contrib-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ define([
onSlide: _.bind(this.handleSlide, this)
});
this.oldValue = 0;

if (this._deferEnable) {
this.setAllItemsEnabled(true);
}
},

handleSlide: function (position, value) {
Expand Down Expand Up @@ -133,9 +137,13 @@ define([

setAllItemsEnabled: function(isEnabled) {
if (isEnabled) {
this.$('.slider-widget').removeClass('disabled');
this.$slider.prop('disabled', false);
this.$slider.rangeslider('update', true);
if (this.$slider) {
this.$('.slider-widget').removeClass('disabled');
this.$slider.prop('disabled', false);
this.$slider.rangeslider('update', true);
} else {
this._deferEnable = true; // slider is not yet ready
}
} else {
this.$('.slider-widget').addClass('disabled');
this.$slider.prop('disabled', true);
Expand Down

0 comments on commit 4400fd1

Please sign in to comment.