Skip to content

Commit

Permalink
fix openPanel button issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcrb3 committed Jun 5, 2024
1 parent 1dbd9d6 commit de190bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
display: block;
}

#openPanel {
#openPanelBtn {
position: absolute;
top: 20px;
left: 10px;
Expand Down Expand Up @@ -293,7 +293,7 @@
}
</style>

<script type="module" crossorigin src="/assets/index-B2Pisj5J.js"></script>
<script type="module" crossorigin src="/assets/index-WDeUfrCN.js"></script>
</head>

<body>
Expand Down Expand Up @@ -325,7 +325,7 @@
</div>
</div>

<span id="openPanel" onclick="openPanel()">&#9776;</span>
<span id="openPanelBtn" onclick="openPanel()">&#9776;</span>

</body>

Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
display: block;
}

#openPanel {
#openPanelBtn {
position: absolute;
top: 20px;
left: 10px;
Expand Down Expand Up @@ -324,7 +324,7 @@
</div>
</div>

<span id="openPanel" onclick="openPanel()">&#9776;</span>
<span id="openPanelBtn" onclick="openPanel()">&#9776;</span>
<script type="module" src="./src/main.js"></script>

</body>
Expand Down
6 changes: 3 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ function openPanel() {
var infoPanel = document.getElementById("infoPanel");
infoPanel.classList.add("open");
infoPanel.style.width = "400px"; // Amplada del panell quan està obert
document.getElementById("openPanel").style.display = "none"; // Amagar el botó d'obrir quan el panell està obert
document.getElementById("openPanelBtn").style.display = "none"; // Amagar el botó d'obrir quan el panell està obert
}

function closePanel() {
var infoPanel = document.getElementById("infoPanel");
infoPanel.classList.remove("open");
infoPanel.style.width = "0px"; // Tancar el panell
document.getElementById("openPanel").style.display = "block"; // Mostrar el botó d'obrir quan el panell està tancat
document.getElementById("openPanelBtn").style.display = "block"; // Mostrar el botó d'obrir quan el panell està tancat
}
function init() {
initMap();
Expand All @@ -310,7 +310,7 @@ function init() {
serveiSelector2.addEventListener('change', onBaseChange);

// Altres funcions d'inicialització aquí si n'hi ha
const openPanelButton = document.getElementById("openPanel");
const openPanelButton = document.getElementById("openPanelBtn");
openPanelButton.addEventListener('click', openPanel);
const closePanelButton = document.getElementById("closePanel");
closePanelButton.addEventListener('click', closePanel);
Expand Down

0 comments on commit de190bd

Please sign in to comment.