require(['splunkjs/mvc/simplexml/ready!'], function() { require(['splunkjs/ready!', 'splunkjs/mvc'], function(mvc) { // For each button with the class "custom-sub-nav" $('.custom-modal').each(function() { var $btn_group = $(this); /* for each button in this nav with the class "modal": - retrieve the modal window ID from data-modal-name attr of the button - open the modal This trick is required since Splunk 8.0.0 which stripes out the native data-togle Example:
*/ $btn_group.find('button').on('click', function() { var $btn = $(this); var modal_name = $btn.attr('data-modal-name'); var modal_id = "#" + modal_name $(modal_id).modal(); }); $btn_group.find('a').on('click', function() { var $btn = $(this); var modal_name = $btn.attr('data-modal-name'); var modal_id = "#" + modal_name $(modal_id).modal(); }); }); }); });