From a7cf20e34f9d498139286b653b13b5296a89be32 Mon Sep 17 00:00:00 2001 From: ColinFrick Date: Fri, 7 Sep 2018 20:13:14 +0200 Subject: [PATCH] fix(checkbox): prevent before callbacks on init if fireOnInit is false Closes #114 --- src/definitions/modules/checkbox.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index b3a6c1da8b..7e84d4bac3 100644 --- a/src/definitions/modules/checkbox.js +++ b/src/definitions/modules/checkbox.js @@ -339,7 +339,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow check, checkbox is already checked'); return false; } - if(settings.beforeChecked.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeChecked.apply(input) === false) { module.debug('Should not allow check, beforeChecked cancelled'); return false; } @@ -350,7 +350,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow uncheck, checkbox is already unchecked'); return false; } - if(settings.beforeUnchecked.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeUnchecked.apply(input) === false) { module.debug('Should not allow uncheck, beforeUnchecked cancelled'); return false; } @@ -361,7 +361,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow indeterminate, checkbox is already indeterminate'); return false; } - if(settings.beforeIndeterminate.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeIndeterminate.apply(input) === false) { module.debug('Should not allow indeterminate, beforeIndeterminate cancelled'); return false; } @@ -372,7 +372,7 @@ $.fn.checkbox = function(parameters) { module.debug('Should not allow determinate, checkbox is already determinate'); return false; } - if(settings.beforeDeterminate.apply(input) === false) { + if(!module.should.ignoreCallbacks() && settings.beforeDeterminate.apply(input) === false) { module.debug('Should not allow determinate, beforeDeterminate cancelled'); return false; }