# j-SnackBar

> j-SnackBar: singleton; wiadomość informacyjna SETTER('snackbar/show', 'MESSAGE', '[Buttonówka]', [CallBackDismiss])

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: pl
Content-SHA256: 2a07ca2d6940f857bd73bde85687f4dfd2004a2917978d1c73b405291ed65862
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- Singleton
- Informacje o `SETTER('snackbar/show', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])`
- Wiadomość sukcesu `SETTER('snackbar/success', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])`
- Wiadomość `SETTER('snackbar/warning', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])`
- _NOW_ wiadomość oczekiwania `SETTER('snackbar/waiting', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])`
- `message` może zawierać kod `HTML`


__Konfiguracja__:

- `button {String}` A etykieta przycisk wycofania (default: `OK`)
- `timeout {Number}` A timeout w milisekundach (default: `4000`)

__Praca z asystentem__:

- Błędy są automatycznie popełnione

```javascript
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('snackbar/response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('snackbar/response', 'Profile has been saved successfully', function(response) {
	console.log(response);
}));

// Or with a callback and without a message
AJAX('POST /api/profile/', userprofile, ASETTER('snackbar/response', function(response) {
	console.log(response);
}));

// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('snackbar/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('snackbar/response', 'Your message', '?.response'));
```

Użyj go z `<ui-component name="snackbar">`Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu `DEF.fallback` (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

```html example.html
<ui-component name="snackbar"></ui-component>

<div style="position: absolute; bottom: 0; left: 10px;">
	<a href="https://totaljs.com" title="totaljs.com">Totaljs.com</a>
</div>
<div style="position: absolute; bottom: 0; right: 50px;">
	<a href="https://componentator.com" title="componentator.com">Componentator.com</a>
</div>

<script>
	SETTER(true, 'snackbar/success', 'This is a message!', function() {
		// Optional
		console.log('Dismiss');
	});
</script>
```
