From d9c3323949052dd4b431263fb4de8a3a0502de16 Mon Sep 17 00:00:00 2001 From: cerlestes Date: Wed, 29 Jun 2016 11:55:14 +0200 Subject: [PATCH] Always add the active class The active CSS class should always be set, otherwise it cannot be styled via CSS --- src/clockpicker.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/clockpicker.js b/src/clockpicker.js index 7f208aa..6044fe2 100644 --- a/src/clockpicker.js +++ b/src/clockpicker.js @@ -638,12 +638,14 @@ this[this.currentView] = value; this[isHours ? 'spanHours' : 'spanMinutes'].html(leadingZero(value)); - // If svg is not supported, just add an active class to the tick + // Add an active class to the tick + this[isHours ? 'hoursView' : 'minutesView'].find('.clockpicker-tick').each(function(){ + var tick = $(this); + tick.toggleClass('active', value === + tick.html()); + }); + + // Stop if not supporting SVG if (! svgSupported) { - this[isHours ? 'hoursView' : 'minutesView'].find('.clockpicker-tick').each(function(){ - var tick = $(this); - tick.toggleClass('active', value === + tick.html()); - }); return; }