Skip to content

Instantly share code, notes, and snippets.

@PunchRockgroin
Created January 12, 2014 19:23
Show Gist options
  • Save PunchRockgroin/8389188 to your computer and use it in GitHub Desktop.
Save PunchRockgroin/8389188 to your computer and use it in GitHub Desktop.
Gumby close modal on click outside
$('.modal').on(Gumby.click, function(e){
var container = $('.content');
if((!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0)) // ... nor a descendant of the container
{
$('.modal .close').trigger('gumby.trigger');
}
});
@jasontipton
Copy link

Thank you for creating the script. I added it to the Magento + Gumby theme I am creating. I have credited you both in the .phtml file and in the humans.txt file.
http://dev.frontlinedev.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment