Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Klick on icon toggle #935

Open
Enrica-r opened this issue May 16, 2014 · 3 comments
Open

Feature request: Klick on icon toggle #935

Enrica-r opened this issue May 16, 2014 · 3 comments

Comments

@Enrica-r
Copy link

If the user klicks on the icon datepicker is shown. A next klick on it keeps the shown status. It would be better to close it (toggle status).

@ahx
Copy link

ahx commented Jun 13, 2014

👍

@ozgrozer
Copy link

I had the same problem and in the end solved this way. You can toggle it with following hack.

$(".datepicker").datepicker({
    autoclose:true
}).on("click",function(e){
    if($(this).hasClass("close")){
        $(this).removeClass("close").addClass("open");
    }else{
        $(this).removeClass("open").addClass("close");
        $(this).datepicker("hide");
    }
}).on("changeDate",function(e){
    $(this).removeClass("open").addClass("close");
}).on("hide",function(e){
    $(this).removeClass("open").addClass("close");
});

@Enrica-r
Copy link
Author

@ozgrozer Thank you for your hack. I will try it. Are the events "changeDate" and "hide" necessary? They should be covered by DP already.

@Azaret Azaret mentioned this issue Oct 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants