PageSourceSearch

https://seoulcenter.vn/wp-content/themes/seoulcenter-v2/assets/v3/js/dist/ButtonSurveyMobile.min.js?ver=7.1

js seoulcenter.vn collected 2026-09-24 10:09:06 UTC 3,985 bytes, 112 lines download raw bytes

1/******/ (() => { // webpackBootstrap
2/******/ 	"use strict";
3var __webpack_exports__ = {};
4
5;// CONCATENATED MODULE: ./ButtonSurveyMobile/HandleSurvey.js
6/* harmony default export */ const HandleSurvey = ({
7  init: function init() {
8    this.handle();
9  },
10  handle: function handle() {
11    var buttonActiveForm = document.querySelector('.button-active-form');
12    var modalSurveyMobile = document.querySelector("#modalSurveyMobile");
13    if (!buttonActiveForm) {
14      return;
15    }
16    var btnSurvey = buttonActiveForm.querySelector('.btn-survey');
17    var buttonClose = buttonActiveForm.querySelector('.button-close');
18    this.handleBtnSurvey(buttonActiveForm, modalSurveyMobile, btnSurvey);
19    this.handleCloseBtnSurvey(buttonActiveForm, buttonClose);
20  },
21  // xử lý button khi click
22  handleBtnSurvey: function handleBtnSurvey(buttonActiveForm, modalSurveyMobile, btnSurvey) {
23    var _this = this;
24    if (!btnSurvey) {
25      return;
26    }
27    btnSurvey.addEventListener('click', function () {
28      var isButtonActiveForm = buttonActiveForm.classList.contains('active');
29      if (!isButtonActiveForm) {
30        buttonActiveForm.classList.add('active');
31      } else {
32        var dataGreenPopup = btnSurvey.dataset.greenpopup;
33        if (buttonActiveForm.classList.contains('button-active-form-greenpopup') && dataGreenPopup) {
34          // Gọi hàm lepopup_popup_open với tham số từ data-greenpopup
35          lepopup_popup_open(dataGreenPopup);
36        }
37        _this.handleToggleModalSurvey(modalSurveyMobile);
38      }
39    });
40  },
41  // xử lý ẩn button 
42  handleCloseBtnSurvey: function handleCloseBtnSurvey(buttonActiveForm, buttonClose) {
43    var _this2 = this;
44    if (!buttonClose) {
45      return;
46    }
47    buttonClose.addEventListener("click", function () {
48      _this2.toggleActiveState(buttonActiveForm);
49    });
50  },
51  // xử lý modal  
52  handleToggleModalSurvey: function handleToggleModalSurvey(modalSurveyMobile) {
53    var isSurveyMobileActive = modalSurveyMobile.classList.contains("active");
54    if (isSurveyMobileActive) {
55      this.hideModal(modalSurveyMobile);
56    } else {
57      this.showModal(modalSurveyMobile);
58    }
59  },
60  toggleActiveState: function toggleActiveState(element) {
61    element.classList.toggle('active');
62  },
63  hideModal: function hideModal(modal) {
64    var modalInstance = bootstrap.Modal.getInstance(modal);
65    modalInstance.hide();
66  },
67  showModal: function showModal(modal) {
68    var newModal = new bootstrap.Modal(modal);
69    newModal.show();
70  }
71});
72;// CONCATENATED MODULE: ./ButtonSurveyMobile/ScrollSurvey.js
73/* harmony default export */ const ScrollSurvey = ({
74  init: function init() {
75    this.handle();
76  },
77  handle: function handle() {
78    var buttonActiveForm = document.querySelector('.button-active-form');
79    if (!this.isMobile()) {
80      // Chỉ thực hiện handleScroll nếu không phải là thiết bị di động
81      this.handleScroll(buttonActiveForm);
82    }
83  },
84  handleScroll: function handleScroll(buttonActiveForm) {
85    var body = document.querySelector('body');
86    var valueScroll = body.scrollHeight * 0.1;
87    if (window.scrollY > valueScroll && buttonActiveForm) {
88      var active = buttonActiveForm.classList.contains('active');
89      var inActive = buttonActiveForm.classList.contains('inActive');
90      if (!active && !inActive) {
91        buttonActiveForm.classList.add('active');
92        buttonActiveForm.classList.add('inActive');
93      }
94    }
95  },
96  isMobile: function isMobile() {
97    // Kiểm tra User Agent string để xác định thiết bị là mobile hay không
98    var userAgent = navigator.userAgent.toLowerCase();
99    return /mobile|android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent);
100  }
101});
102;// CONCATENATED MODULE: ./ButtonSurveyMobile.js
103
104
105document.addEventListener("DOMContentLoaded", function () {
106  HandleSurvey.init();
107});
108window.addEventListener('scroll', function () {
109  ScrollSurvey.init();
110});
111/******/ })()
112;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.