Commit 1e6095c9 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'ps-fix-bootstrap-confirm-modals-while-pending' into 'master'

Add ignoreWhilePending to railsUjs

See merge request gitlab-org/gitlab!81844
parents c101f3de 8fda49ff
import Rails from '@rails/ujs';
import { confirmViaGlModal } from './confirm_via_gl_modal/confirm_via_gl_modal';
import { ignoreWhilePending } from './ignore_while_pending';
function monkeyPatchConfirmModal() {
/**
......@@ -18,8 +19,10 @@ function monkeyPatchConfirmModal() {
* @param element {HTMLElement} Element that was clicked on
* @returns {boolean}
*/
const safeConfirm = ignoreWhilePending(confirmViaGlModal);
function confirmViaModal(message, element) {
confirmViaGlModal(message, element)
safeConfirm(message, element)
.then((confirmed) => {
if (confirmed) {
Rails.confirm = () => true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment