|
|
|
@ -63,21 +63,11 @@ var css = csjs` |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
module.exports = (title, content, ok, cancel) => { |
|
|
|
|
var containerOrig = document.querySelector('.modal') |
|
|
|
|
var container |
|
|
|
|
if (!containerOrig) { |
|
|
|
|
container = document.querySelector(`.${css.modal}`) |
|
|
|
|
var container = document.querySelector(`.${css.modal}`) |
|
|
|
|
if (!container) { |
|
|
|
|
document.querySelector('body').appendChild(html()) |
|
|
|
|
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') |
|
|
|
|
okDiv.innerHTML = (ok && ok.label !== undefined) ? ok.label : 'OK' |
|
|
|
|