From d6af2239d1874765ef286f7e1bc14dd642207d42 Mon Sep 17 00:00:00 2001 From: SumanRajSharma Date: Wed, 21 Sep 2016 15:12:18 +0545 Subject: [PATCH] Added support to disable the toggle --- js/toggles.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/toggles.js b/js/toggles.js index f596a16..2a0b2e0 100644 --- a/js/toggles.js +++ b/js/toggles.js @@ -37,6 +37,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var toggleWidth = toggle.clientWidth; @@ -57,6 +60,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var current = e.touches[0]; @@ -89,6 +95,9 @@ if (!toggle) { return; } + if(toggle.classList.contains('disabled')) { + return; + } var handle = toggle.querySelector('.toggle-handle'); var toggleWidth = toggle.clientWidth;