BaseModal.js 726 Bytes
Newer Older
arturo's avatar
arturo committed
1 2
'use strict';

3 4 5 6 7 8
/**
 * @function show
 * @param {Window} window
 * @param {string} querySelector
 * @unpure {Object} window.$
 */
9
export function _show(window, querySelector) {
10
  window.$(querySelector).modal('show');
arturo's avatar
arturo committed
11
}
12 13 14 15 16 17
/**
 * @function hide
 * @param {Window} window
 * @param {string} querySelector
 * @unpure {Object} window.$
 */
18
export function _hide(window, querySelector) {
19 20 21 22 23 24
  window.$(querySelector).modal('hide');
  // @XXX Bootstrap not removing some modal elements on "hide" method
  // @https://stackoverflow.com/questions/50168312/bootstrap-4-close-modal-backdrop-doesnt-disappear
  window.$('body').removeClass('modal-open');
  window.$('body').css('padding-right', '0');
  window.$('.modal-backdrop').remove();
arturo's avatar
arturo committed
25
}