New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(doc): add info to show notification programmatically #722
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
docs/componenti/notifiche.md
Outdated
|
||
Attiva una notifica senza scrivere codice JavaScript. Imposta `data-bs-toggle="notification"` su un elemento di controllo, come un | ||
pulsante, insieme a `data-bs-target="#foo"` o `href="#foo"` per attivare/disattivare una specifica notifica. | ||
E' possibile specificare il tempo di permanenza della notifica mediante l'attributo `data-bs-timeout`: il suo valore rappresenta i millisecondi nei quali la notifica resterà visibile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usiamo la È
docs/componenti/notifiche.md
Outdated
<button type="button" data-bs-toggle="notification" data-bs-target="#myNotification" data-bs-timeout="5000">Lancia la notifica</button> | ||
``` | ||
|
||
L'attributo `data-bs-timeout` può essere assegnato anche direttamente al componente notifica. In tal caso non sarà necessario assegnarlo anche al pulsante di avvio. Se l'attributo è specificato anche nel pulsante di avvio, verrà preso come tempo di permanenza il valore di quest'ultimo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non mi torna il significato di "tempo di permanenza"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Utilizzerei anche il termine timeout nel caso..
docs/componenti/notifiche.md
Outdated
Richiama una notifica con id `myNotification` con una singola riga di JavaScript: | ||
|
||
```js | ||
var myNotification = new bootstrap.Notification(document.getElementById('myNotification'), options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usiamo const
invece di var
docs/componenti/notifiche.md
Outdated
Durante la creazione di un'istanza Notification è possibile passare un oggetto per la configurazione (opzionale). | ||
|
||
```js | ||
var myNotification = new bootstrap.Notification(document.getElementById('myNotification'), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usiamo const
invece di var
docs/componenti/notifiche.md
Outdated
myNotification.show() | ||
``` | ||
|
||
E' possibile passare come parametro il valore in millisecondi di permanenza della notifica. Se non viene specificato, il tempo di permanenza verrà ricavato dal parametro di configurazione `timeout` o dal data attribute `data-bs-timeout`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usiamo la È
. Anche qui non mi torna "tempo di permanenza"
Descrizione
Checklist