j-NotificationsPanel
- Singleton
- Naucz się z przykładu
Konfiguracja:
top {Number}top offset (default:0)visibleY {Boolean}wyświetla Y scrollbars (default:true)- Tytuł
title {String}w panelu powiadomień (default:Notifications) autoremove {Boolean}usuwa powiadomienia po kliknięciu na nich (default:true)click {String}jest drogą do metodyfunction(obj, el), gdy użytkownik kliknie na powiadomieniaexec {String}jest drogą do metodyfunction(render(ARR_OF_OBJECT))kiedy użytkownik chce wyświetlić powiadomienia
Użyj go z <ui-component name="notificationspanel">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.
<ui-component name="notificationspanel" path="shownotifications" config="exec:loadnotifications;click:clicknotificiation">
<script type="text/html">
<h2>{{ name }}</h2>
<p>{{ body }}</p>
<hr />
</script>
</ui-component>
<script>
var shownotifications = false;
// Shows notifications panel after 2 seconds
SET('shownotifications', true, 2000);
// The method will be executed automatically before the notifications panel will be visible
function loadnotifications(render) {
var arr = [];
arr.push({ name: 'Name of notifications 1', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
arr.push({ name: 'Name of notifications 2', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
arr.push({ name: 'Name of notifications 3', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos, architecto!' });
// IMPORTANT:
// This renders notifications onto notifications panel
render(arr);
}
function clicknotificiation(obj) {
console.log('CLICK', obj);
}
</script>