import $ from 'jquery';

// Replicate the ConfirmDialog setButtonsDisabled method
export default (dialog, disabled) => {
    const $buttons = dialog.$el.find('.aui-dialog2-footer-actions .aui-button');

    $buttons.each(() => {
        const $button = $(this);
        $button.prop("disabled", disabled).toggleClass("disabled", disabled);
        if (disabled) {
            $button.attr("aria-disabled", "true");
        } else {
            $button.removeAttr("aria-disabled");
        }
    });
}
