Add convenience dialog_button() JS function

This commit is contained in:
Lance Edgar 2017-05-17 14:02:00 -05:00
parent 76e71d634e
commit d6bc584831

View file

@ -68,6 +68,24 @@ function get_uuid(obj) {
}
/*
* Return a jQuery object containing a button from a dialog. This is a
* convenience function to help with browser differences. It is assumed
* that it is being called from within the relevant button click handler.
* @param {event} event - Click event object.
*/
function dialog_button(event) {
var button = $(event.target);
// TODO: not sure why this workaround is needed for Chrome..?
if (! button.hasClass('ui-button')) {
button = button.parents('.ui-button:first');
}
return button;
}
/*
* reference to existing timeout warning dialog, if any
*/