Skip to content

Commit

Permalink
Corrijo error en botón ver comentarios.
Browse files Browse the repository at this point in the history
  • Loading branch information
elswork committed Dec 9, 2023
1 parent 778b08c commit 1789b50
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
23 changes: 15 additions & 8 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<main id="skip">
<ul class="post-metadata">
<li>
<button onclick="window.location.href='https://github.com/elswork/anticitera.deft.work/edit/main{{ page.inputPath | replace('./', '/') }}'" target="_blank" id="toggle-comments-btn">
<button onclick="window.open('https://github.com/elswork/anticitera.deft.work/edit/main{{ page.inputPath | replace('./', '/') }}', '_blank')" id="edit-github-btn">
Editar en {% icon "simpleicon:github", class="icon" %} GitHub
</button>
</li>
Expand Down Expand Up @@ -155,13 +155,20 @@

<!-- Current page: {{ page.url | htmlBaseUrl }} -->
<script>
document.getElementById('toggle-comments-btn').addEventListener('click', function() {
var container = document.querySelector('.issue-container');
if (container.style.display === 'none' || container.style.display === '') {
container.style.display = 'block';
} else {
container.style.display = 'none';
}
document.addEventListener('DOMContentLoaded', () => {
// ...resto del código para las galerías...
// Bucle para manejar cada botón "Ver Comentarios"
document.querySelectorAll('[id^="toggle-comments-btn"]').forEach(btn => {
btn.addEventListener('click', function() {
var container = this.nextElementSibling; // Selecciona el siguiente elemento después del botón, que debería ser .issue-container
if (container.style.display === 'none' || container.style.display === '') {
container.style.display = 'block';
} else {
container.style.display = 'none';
}
});
});
});
</script>
<script>
Expand Down
4 changes: 2 additions & 2 deletions public/css/bundle.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ button:focus {
display: block;
}

#toggle-comments-btn {
#edit-github-btn, #toggle-comments-btn {
/* Estilos para el botón */
background-color: #d35d23;
color: white;
Expand All @@ -187,7 +187,7 @@ button:focus {
transition: background-color 0.3s; /* Transición suave para el hover */
}

#toggle-comments-btn:hover {
#edit-github-btn:hover, #toggle-comments-btn:hover {
background-color: #b64309; /* Color de fondo al pasar el ratón por encima */
}

Expand Down

0 comments on commit 1789b50

Please sign in to comment.