Skip to:
Content
Pages
Categories
Search
Top
Bottom

Ability to dismiss template notices

  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    I’m toying with the idea of introducing a dismiss button on template notices so the user is able to remove the message from the page by clicking on a remove icon.

    Is there an easy way to do this? I mean has it already been done?

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    OK so perhaps it hasn’t been. I decided on using this solution if anyone else ever needs it:

    <script>
    $(document).mouseup(function (e)
    {
        var notice = $(".bp-template-notice");
    
        if (!notice.is(e.target)
            && notice.has(e.target).length === 0)
        {
            notice.hide();
        }
    	
    });
    </script>

    This will dismiss the template notice if the user clicks anywhere else on the page. i.e outside of the template notice’s containing div.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.