Ideas

Close picker dropdowns on lost focus

Close picker dropdowns on lost focus

Other

It'd be a good boost to our staff's sanity if the picker dropdowns would close when we click away from them. I'm not sure if staying open was an intentional behavior, but most dropdowns throughout the rest of the web close when they lose focus so it's pretty jarring when many places in Rock don't follow the same pattern.

Photo of Jeff Richmond Submitted by Jeff Richmond, The Well Community Church  ·   ·  Other
Login to add a comment...

  • Jeff Richmond

    In the meantime, I came up with some JavaScript to solve the problem. Just go to Admin Tools > CMS Configuration > Sites > [your internal site] and place this in the Advanced Settings > Page Header Content field...


    $(document).ready(function()
    {
    //close picker dropdowns when clicking outside of the picker
    $(window).click(function()
    {
    $('.picker-label').each(function()
    {
    var $picker = $(this);
    if ($picker.siblings('.picker-menu:visible').length) { $picker.click(); }
    });
    });
    //prevent clicks within the picker from closing the dropdowns
    $('body').on('click', '.picker-label, .picker-menu', function(e) { e.stopPropagation(); });
    });

    Edit: Apparently this editor doesn't like apostrophe's in code blocks, so make sure you change all every ' to an apostrophe.