bundles/Bgt/UcBundle/Resources/views/layout/_dynamic-call.html.twig line 1
<div id="web_modal_default" class="modal" tabindex="-1">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
</div>
</div>
</div>
<script src="{{ asset('asset/dynamic_call/dynamic_call.js') }}" type="text/javascript"></script>
<script type="text/javascript">
let loader = $('.preloader');
let dynamicCall = new DynamicCall({
toastShow: toastShow,
modalShow: modalShow,
modalHide: modalHide,
loaderShow: loaderShow,
loaderHide: loaderHide,
});
function toastShow(toastData) {
if (toastData.status === "success") {
toastr.success(message);
} else if (toastData.status === "warning") {
toastr.warning(message);
} else if (toastData.status === "info") {
toastr.info(message);
} else if (toastData.status === "error") {
toastr.error(message);
}
}
function modalShow(modalData) {
let modal = $("#web_modal_default");
modal.find(".modal-header").first().html(modalData.title);
modal.find(".modal-body").first().html(modalData.content);
modal.modal('show');
let button = modal.find(".mdl_submit").first();
if (modalData.submitText && modalData.submitText.length > 0) {
button.html(modalData.submitText);
button.show();
} else {
button.hide();
}
}
function modalHide() {
let modal = $("#web_modal_default");
modal.modal('hide');
}
function loaderShow() {
loader.show();
}
function loaderHide() {
loader.hide();
}
function errorHandle(error) {
let response = error.response;
if (response.status === 404) {
toastr.error('Мэдээлэл олдсонгүй!');
} else if (response.status === 403) {
toastr.error('Таны хандах эрх хүрэхгүй байна!');
} else {
toastr.error('Уучлаарай дахин оролдоно уу.');
}
}
</script>