j-NotificationsPanel
- singleton
- Apprendre de l’exemple
Configuration :
top {Number}Top Offset (defaut :0)visibleY {Boolean}montre les barres de scroll Y (defaut:true)- Titre
title {String}dans le panneau de notifications (defaut:Notifications) autoremove {Boolean}supprime les notifications après avoir cliqué sur elle (defaut:true)click {String}un chemin vers la méthodefunction(obj, el)lorsque l'utilisateur clique sur les notificationsexec {String}un chemin vers la méthodefunction(render(ARR_OF_OBJECT))lorsque l'utilisateur veut afficher les notifications
Utilisez-le avec <ui-component name="notificationspanel">. Lorsque le composant n'est pas encore chargé, jComponent le télécharge lors de la première utilisation depuis l'adresse dans DEF.fallback (le CDN Componentator par défaut). Auteur : Peter Širka. Source : le référentiel de composants Componentator, licence 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>