// Workaround for https://github.com/ivaynberg/select2/issues/1246
$.ui.dialog.prototype._allowInteraction = function(e) {
- return !!$(e.target).closest('.ui-dialog, .ui-datepicker, .select2-drop, .cke_dialog').length;
+ return !!$(e.target).closest('.ui-dialog, .ui-datepicker, .select2-drop, .cke_dialog, #civicrm-menu').length;
};
+ // Implements jQuery hook.prop
+ $.propHooks.disabled = {
+ set: function (el, value, name) {
+ // Sync button enabled status with wrapper css
+ if ($(el).is('span.crm-button > input.crm-form-submit')) {
+ $(el).parent().toggleClass('crm-button-disabled', !!value);
+ }
+ // Sync button enabled status with dialog button
+ if ($(el).is('.ui-dialog input.crm-form-submit')) {
+ $(el).closest('.ui-dialog').find('.ui-dialog-buttonset button[data-identifier='+ $(el).attr('name') +']').prop('disabled', value);
+ }
+ if ($(el).is('.crm-form-date-wrapper .crm-hidden-date')) {
+ $(el).siblings().prop('disabled', value);
+ }
+ }
+ };
+
/**
* Populate a select list, overwriting the existing options except for the placeholder.
* @param select jquery selector - 1 or more select elements