mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-06-08 00:42:19 +02:00
Déplacement de la notif dans les panel
This commit is contained in:
parent
e4a6439acb
commit
51e43bf38c
|
@ -147,7 +147,7 @@ h1 {
|
||||||
#panel-area {
|
#panel-area {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
font-size: 24px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#input-area {
|
#input-area {
|
||||||
|
@ -274,6 +274,10 @@ h1 {
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#panel-fenetre-notification-area {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
#notification-label,
|
#notification-label,
|
||||||
#panel-fenetre-notification-label {
|
#panel-fenetre-notification-label {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
|
|
|
@ -123,10 +123,10 @@ export default class FinDePartiePanel {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.");
|
NotificationMessage.ajouterNotificationPanel("Résumé copié dans le presse-papier.", resumeBouton);
|
||||||
})
|
})
|
||||||
.catch((raison) => {
|
.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);
|
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);
|
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 {
|
private static ajouterNotificationDiv(divArea: HTMLElement, divLabel: HTMLElement, message: string): void {
|
||||||
|
|
Loading…
Reference in a new issue