Skip to content

Instantly share code, notes, and snippets.

@mlauren
Created October 18, 2013 15:01
Show Gist options
  • Save mlauren/7042875 to your computer and use it in GitHub Desktop.
Save mlauren/7042875 to your computer and use it in GitHub Desktop.
global modal function
/**
* Modals for group roster options.
*/
Drupal.behaviors.apci_show_hide_roster_options = function(context) {
var modals = $('.apci-modal');
$(window).load(function(){
modals.appendTo('body');
});
callOnce('.show-options', 'show-options-processed', context, function(element) {
element.click(function(){
var clickedDataRel = $(this).attr('data'),
targetDataRel = $('.apci-modal[data=' + clickedDataRel + ']').attr('data');
if (clickedDataRel == targetDataRel) {
$('.apci-modal[data=' + targetDataRel + ']').reveal();
return false;
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment