You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
some changes
This commit is contained in:
@@ -3,15 +3,15 @@ $(document).ready(function() {
|
||||
var modalPanel = $(".modal-panel");
|
||||
var openBtn = $(".settings");
|
||||
var closeBtn = $(".closeModal, .closeModalButton");
|
||||
|
||||
|
||||
initPopups();
|
||||
|
||||
|
||||
openBtn.on("click", function() {
|
||||
openModal(modalPanel);
|
||||
});
|
||||
|
||||
|
||||
closeBtn.on("click", closeModal);
|
||||
|
||||
|
||||
function openModal(panel) {
|
||||
modal.css("display", "block");
|
||||
panel.css("display", "block");
|
||||
@@ -20,7 +20,7 @@ $(document).ready(function() {
|
||||
modal.css("opacity", 1);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
|
||||
function closeModal() {
|
||||
modal.css("opacity", 0);
|
||||
setTimeout(function() {
|
||||
@@ -28,24 +28,20 @@ $(document).ready(function() {
|
||||
$("body").removeClass("modal-open"); // Enable body scrolling
|
||||
}, 300);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).on("click", function(event) { // Close the modal when clicking outside of it
|
||||
if ($(event.target).is(modal)) {
|
||||
closeModal();
|
||||
}
|
||||
if ($(event.target).is(modal)) closeModal();
|
||||
});
|
||||
|
||||
|
||||
$(document).on("keydown", function(event) { // Close the modal when pressing ESC key
|
||||
if (event.key === "Escape") {
|
||||
closeModal();
|
||||
}
|
||||
if (event.key === "Escape") closeModal();
|
||||
});
|
||||
|
||||
$(".tuner-mobile-settings").on("click", function () {
|
||||
togglePopup("#popup-panel-mobile-settings");
|
||||
});
|
||||
|
||||
|
||||
$("#data-station-others").on("click", function () {
|
||||
togglePopup("#popup-panel-transmitters");
|
||||
});
|
||||
@@ -54,13 +50,13 @@ $(document).ready(function() {
|
||||
function initPopups() {
|
||||
$(".popup-window").draggable({
|
||||
handle: ".popup-header",
|
||||
containment: "body"
|
||||
containment: "body"
|
||||
}).resizable({
|
||||
minHeight: 330,
|
||||
minWidth: 350,
|
||||
containment: "body"
|
||||
});
|
||||
|
||||
|
||||
$(".popup-close").on("click", function () {
|
||||
$(".popup-window").fadeOut(200);
|
||||
});
|
||||
@@ -69,9 +65,8 @@ function initPopups() {
|
||||
function togglePopup(targetSelector) {
|
||||
const $target = $(targetSelector);
|
||||
|
||||
if ($target.is(":visible")) {
|
||||
$target.fadeOut(200);
|
||||
} else {
|
||||
if ($target.is(":visible")) $target.fadeOut(200);
|
||||
else {
|
||||
$(".popup-window").fadeOut(200);
|
||||
$target.fadeIn(200);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user