jdewit / bootstrap-timepicker

[Deprecated] A simple timepicker component for Twitter Bootstrap
MIT License
1.64k stars 1.09k forks source link

hide bootstrap-timepicker-widget? #295

Open sau-152mm opened 9 years ago

sau-152mm commented 9 years ago

if you click on the button (input-group-addon) again to close(hide) the block - bootstrap-timepicker-widget?

mrhota commented 9 years ago

What are you asking? I don't understand the question.

mesuttalebi commented 8 years ago

Hi, could we enable hiding widget when escape pressed?

ttyson99 commented 8 years ago

I believe the op is asking that the widget hides when the input-group-addon icon is clicked a second time. (The first click currently shows the widget.) If the op is not asking this, then I am.

vamsiampolu commented 8 years ago

Check this jsbin, I am calling the showWidget and hideWidget methods with a flag that I set and unset whenever the input-group-addon is clicked.

var isHidden = false;

    $('.timepicker-toggle').on('click',function(e){
      if(!isHidden) {
         $('#timepicker').timepicker('hideWidget'); 
        isHidden=true;
      } else {
        $('#timepicker').timepicker('showWidget');
        isHidden = false;
      }
wilga commented 8 years ago

357 Add one line to fix this issue.