mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2025-04-08 19:25:14 +02:00
Déplacement de la notif dans les panel
This commit is contained in:
parent
e4a6439acb
commit
51e43bf38c
3 changed files with 11 additions and 4 deletions
|
@ -147,7 +147,7 @@ h1 {
|
|||
#panel-area {
|
||||
display: none;
|
||||
|
||||
font-size: 24px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#input-area {
|
||||
|
@ -274,6 +274,10 @@ h1 {
|
|||
min-height: 50px;
|
||||
}
|
||||
|
||||
#panel-fenetre-notification-area {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#notification-label,
|
||||
#panel-fenetre-notification-label {
|
||||
font-size: 22px;
|
||||
|
|
|
@ -123,10 +123,10 @@ export default class FinDePartiePanel {
|
|||
})
|
||||
)
|
||||
.then(() => {
|
||||
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.");
|
||||
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.", resumeBouton);
|
||||
})
|
||||
.catch((raison) => {
|
||||
NotificationMessage.ajouterNotificationPanel("Votre navigateur n'est pas compatible.");
|
||||
NotificationMessage.ajouterNotificationPanel("Votre navigateur n'est pas compatible.", resumeBouton);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,8 +9,11 @@ export default class NotificationMessage {
|
|||
this.ajouterNotificationDiv(this._notificationArea, this._notificationLabel, message);
|
||||
}
|
||||
|
||||
public static ajouterNotificationPanel(message: string): void {
|
||||
public static ajouterNotificationPanel(message: string, origine: HTMLElement): void {
|
||||
this.ajouterNotificationDiv(this._notificationPanelArea, this._notificationPanelLabel, message);
|
||||
const { top: topParent, left: leftParent } = origine.getBoundingClientRect();
|
||||
this._notificationPanelArea.style.top = `${topParent + 30}px`;
|
||||
this._notificationPanelArea.style.left = `${leftParent - this._notificationPanelArea.getBoundingClientRect().width / 2}px`;
|
||||
}
|
||||
|
||||
private static ajouterNotificationDiv(divArea: HTMLElement, divLabel: HTMLElement, message: string): void {
|
||||
|
|
Loading…
Add table
Reference in a new issue