You can find a recent request to extract useful data: Allow passing arguments of data to modal
This commit modifies the Modal plugin so that it captures all the data attributes in the launcher. By adding unique identifiers in all launch elements, say data-user="some_uid" , data can be obtained from a modal object in the future.
For example, if the buttons in the example are used:
<button data-user="4" ... > <button data-user="5" ... > <button data-user="6" ... >
In callbacks, you can access this information:
// Hide modal if "Okay" is pressed $('#my-modal').on('click', '.okay-button', function(e) { var modal = $(e.delegateTarget).data('modal'); console.log('Originating element user: ' + modal.options.user); modal.hide(); });
Note I understand that the API for the mod has changed significantly since this question was asked, and partly why I masked the other details of the button layout. However, I think the problem that will be solved is still relevant.
source share