Browse Source

Fixed events still firing while disabled

pull/4212/head
Gareth Daunton 8 years ago
parent
commit
c71bdc8beb
1 changed files with 13 additions and 4 deletions
  1. 17
      src/definitions/modules/range.js

17
src/definitions/modules/range.js

@ -71,7 +71,8 @@ $.fn.range = function(parameters) {
module.debug('Initializing range slider', settings);
isTouch = module.get.isTouch();
module.setup.layout();
module.bind.events();
if(!module.is.disabled())
module.bind.events();
module.read.metadata();
module.read.settings();
module.instantiate();
@ -167,7 +168,8 @@ $.fn.range = function(parameters) {
event: {
down: function(event, originalEvent) {
event.preventDefault();
module.bind.documentEvents();
if(!module.is.disabled())
module.bind.documentEvents();
},
move: function(event, originalEvent) {
event.preventDefault();
@ -192,6 +194,12 @@ $.fn.range = function(parameters) {
},
},
is: {
disabled: function() {
return $module.hasClass(settings.className.disabled);
}
},
get: {
isTouch: function () {
try {
@ -647,12 +655,13 @@ $.fn.range.settings = {
step : 1,
start : 0,
input : false,
//the decimal place to round to if step is undefined
decimalPlaces : 2,
className : {
reversed : 'reversed'
reversed : 'reversed',
disabled : 'disabled'
},
onChange : function(value){},

Loading…
Cancel
Save