fgelinas/timepicker — Issue #38: Feature Request: Enabling and Disabling also handles button
Author: ruhley
Created: 2012-01-04 02:47:12+00:00
State: open

Can you please disable the button when the widget is disabled for future releases. I did something simple like this.

$(button).bind("click.timepicker", function () {
if ($.timepicker._timepickerShowing && $.timepicker._lastInput == input[0]) { $.timepicker._hideTimepicker(); }
else {$.timepicker._showTimepicker(input[0]); }
return false;
});

to

$(button).bind("click.timepicker", function () {
if ($.timepicker._timepickerShowing && $.timepicker._lastInput == input[0]) { $.timepicker._hideTimepicker(); }
else if (!inst.input.is(':disabled')) {$.timepicker._showTimepicker(input[0]); }
return false;
});

and in the _enableTimepicker function i added $(inst.settings.button).fadeTo(500, 1);
and matching in the _disableTimepicker function $(inst.settings.button).fadeTo(500, 0.4);

Thanks