begin dynamic error modal

toast
Kit Kasune 3 years ago
parent 4bae9b77e4
commit d04d4a2c17
  1. 18
      scripts/modal/common/error.js

@ -0,0 +1,18 @@
const preModal = require("../pre");
const postModal = require('../post');
module.exports = (name, text, after = () => {}) => {
preModal('error-modal');
let modal = document.createElement('div');
modal.className = 'modal';
modal.id = 'error-modal';
document.body.appendChild(modal);
let title = document.createElement('h2');
title.innerHTML = `Error - ${name}`;
modal.appendChild(title);
let err = document.createElement('p');
err.innerHTML = text;
modal.appendChild(err);
after('error-modal');
postModal();
};
Loading…
Cancel
Save