j-NotificationsPanel
- Singleton
- Leer van het voorbeeld
Configuratie:
top {Number}top offset (default:0)visibleY {Boolean}toont Y scrollbars (default:true)title {String}titel in de meldingspaneel (default:Notifications)autoremove {Boolean}verwijdert kennisgevingen na het klikken (default:true)click {String}een route naar de methodefunction(obj, el)wanneer de gebruiker op de meldingen kliktexec {String}een route naar de methodefunction(render(ARR_OF_OBJECT))wanneer de gebruiker de kennisgevingen wil tonen
Gebruik het met <ui-component name="notificationspanel">Wanneer de component nog niet is geladen, jComponent Download het op eerste gebruik van het adres in DEF.fallback (De Componentator Schrijver: Peter Širka. bron: de Componentator Componenten repository, MIT licentie.
<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>