Commit 911e0efb by Takumi Imai

Merge branch 'feature/1.0_check_web_dev_son' into 'feature/1.0_check_web_dev'

implement load confirm modal auto if elementId is null

See merge request !65
parents 8e848331 dae681ef
......@@ -91,7 +91,6 @@
<!-- select template modal -->
<div id="includeTemplateModal"></div>
<div id="includeConfirmModal"></div>
<script type="text/javascript" src="../common/js/app.js"></script>
<script src="../common/js/event.js?__UPDATEID__"></script>
</body>
......
......@@ -128,7 +128,7 @@ SendMessage.init = function () {
//Check if user is logged in
COMMON.checkAuth(false);
TEMPLATE.loadHeader('#includedHeader');
TEMPLATE.loadConfirmModal('#includeConfirmModal');
TEMPLATE.loadConfirmModal();
const navs = [
{
titleLang: 'dashboard',
......
......@@ -33,10 +33,19 @@ TEMPLATE.loadDashboardSetting = function (elmentId, changeCallback) {
};
/**
* Template load confirm model
* @param {*} elmentId
* Template load confirm model to element
* @param {string} elmentId - The element where contain confirm modal html,
* if it empty, auto append div with id includedConfirmModal
*/
TEMPLATE.loadConfirmModal = function (elmentId) {
if (typeof elmentId === undefined || !elmentId) {
if ($('#includedConfirmModal').length < 1) {
//append div with id = includedConfirmModal
let div = $('<div id="includedConfirmModal" />');
$('body').append(div);
elmentId = '#includedConfirmModal';
}
}
$(elmentId).load('../common/html/confirmModal.html', function () {
HEADER.initLogout();
I18N.initi18n();
......
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