From 5ee43bf5c0871dab3cbe1bd5272cfb7b627ef4df Mon Sep 17 00:00:00 2001 From: SumanRajSharma Date: Wed, 21 Sep 2016 15:11:38 +0545 Subject: [PATCH] Added support for disable the toggle --- dist/js/ratchet.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/js/ratchet.js b/dist/js/ratchet.js index 7defe2c..22a86a1 100644 --- a/dist/js/ratchet.js +++ b/dist/js/ratchet.js @@ -989,6 +989,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var toggleWidth = toggle.clientWidth; @@ -1009,6 +1012,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var current = e.touches[0]; @@ -1041,6 +1047,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var toggleWidth = toggle.clientWidth;