Skip to content

Commit

Permalink
fix css error, ensure widget not freezing
Browse files Browse the repository at this point in the history
  • Loading branch information
emnbdx committed Sep 24, 2024
1 parent 58330e5 commit af1e305
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion admin/widget_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@
<!-- Espace réservé pour la prévisualisation -->
<div class="widget-alert-box mt-3 mb-5"
style="min-height: 300px; border: 1px dashed #ccc; padding: 10px">
<p class="text-muted">La prévisualisation apparaîtra ici</p>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@

.widget-alert-box {
text-align: center;
}

.widget-alert-box p {
word-wrap: break-word;
}
2 changes: 1 addition & 1 deletion css/main.min.css

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

4 changes: 2 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var alertQueue = [];
var isAlertActive = false;

function displayAlertBox(pseudo, message, amount) {
message = message.substring(0, 255);
alertQueue.push({ pseudo, message, amount });

if (!isAlertActive) {
Expand All @@ -19,7 +20,6 @@ function processAlertQueue() {
const alert = alertQueue.shift();
const { pseudo, message, amount } = alert;
var container = document.querySelector('.widget-alert-box');
var oldContent = container.innerHTML;
container.innerHTML = '';

// Afficher l'image
Expand Down Expand Up @@ -56,7 +56,7 @@ function processAlertQueue() {
audio.pause();
audio.currentTime = 0;

container.innerHTML = oldContent;
container.innerHTML = '';
processAlertQueue();
}, window.alert_duration);
}
Expand Down
2 changes: 1 addition & 1 deletion js/main.min.js

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

0 comments on commit af1e305

Please sign in to comment.