Skip to content
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

Merged
merged 2 commits into from Sep 12, 2022

Conversation

marsanwedoo
Copy link
Collaborator

Descrizione

Checklist

@vercel
Copy link

vercel bot commented Sep 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
bootstrap-italia ✅ Ready (Inspect) Visit Preview Sep 12, 2022 at 3:29PM (UTC)


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usiamo la È

<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.
Copy link
Member

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"

Copy link
Member

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..

Richiama una notifica con id `myNotification` con una singola riga di JavaScript:

```js
var myNotification = new bootstrap.Notification(document.getElementById('myNotification'), options)
Copy link
Member

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

Durante la creazione di un'istanza Notification è possibile passare un oggetto per la configurazione (opzionale).

```js
var myNotification = new bootstrap.Notification(document.getElementById('myNotification'), {
Copy link
Member

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

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`.
Copy link
Member

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"

@astagi astagi merged commit ec36adb into main Sep 12, 2022
@astagi astagi deleted the feature/notification-doc branch September 12, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

funzione notificationShow non presente in bundle 2.0.3
2 participants