|
|
@ -63,21 +63,11 @@ var css = csjs` |
|
|
|
` |
|
|
|
` |
|
|
|
|
|
|
|
|
|
|
|
module.exports = (title, content, ok, cancel) => { |
|
|
|
module.exports = (title, content, ok, cancel) => { |
|
|
|
var containerOrig = document.querySelector('.modal') |
|
|
|
var container = document.querySelector(`.${css.modal}`) |
|
|
|
var container |
|
|
|
|
|
|
|
if (!containerOrig) { |
|
|
|
|
|
|
|
container = document.querySelector(`.${css.modal}`) |
|
|
|
|
|
|
|
if (!container) { |
|
|
|
if (!container) { |
|
|
|
document.querySelector('body').appendChild(html()) |
|
|
|
document.querySelector('body').appendChild(html()) |
|
|
|
container = document.querySelector(`.${css.modal}`) |
|
|
|
container = document.querySelector(`.${css.modal}`) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
var parent = document.querySelector('body') |
|
|
|
|
|
|
|
var child = document.getElementById('modaldialog') |
|
|
|
|
|
|
|
parent.removeChild(child) |
|
|
|
|
|
|
|
document.querySelector('body').appendChild(html()) |
|
|
|
|
|
|
|
container = document.querySelector(`.${css.modal}`) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var okDiv = document.getElementById('modal-footer-ok') |
|
|
|
var okDiv = document.getElementById('modal-footer-ok') |
|
|
|
okDiv.innerHTML = (ok && ok.label !== undefined) ? ok.label : 'OK' |
|
|
|
okDiv.innerHTML = (ok && ok.label !== undefined) ? ok.label : 'OK' |
|
|
|