33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
import { Controller } from 'stimulus';
|
|
|
|
/*
|
|
* This is an example Stimulus controller!
|
|
*
|
|
* Any element with a data-controller="default" attribute will cause
|
|
* this controller to be executed. The name "default" comes from the filename:
|
|
* default_controller.js -> "default"
|
|
*
|
|
* Delete this file or adapt it for your use!
|
|
*/
|
|
export default class extends Controller {
|
|
connect() {
|
|
this.element.addEventListener('click', function () {
|
|
const popupWrap = document.getElementById('popup');
|
|
popupWrap.querySelector('.modal-title').textContent = 'Техническая поддержка';
|
|
popupWrap.querySelector('.modal-dialog').classList.remove('modal-lg');
|
|
|
|
const popupBody = popupWrap.querySelector('#popup-body');
|
|
popupBody.innerHTML = '';
|
|
|
|
const iframe = document.createElement('iframe');
|
|
iframe.src = 'https://sovaclinic.okdesk.ru/webform/issues?account_name=sovaclinic';
|
|
iframe.frameBorder = 0;
|
|
iframe.height = "450";
|
|
iframe.width = "100%";
|
|
popupBody.append(iframe);
|
|
|
|
$(popupWrap).modal('show');
|
|
})
|
|
}
|
|
}
|