j-NotificationsPanel
- Синглът
- Научете се от примера
Конфигуриране:
top {Number}Оферти за дефолт (по подразбиране:0)visibleY {Boolean}показва Y скалбар (дефолт:true)- Заглавие на
title {String}в панела за уведомления (предварително:Notifications) autoremove {Boolean}премахва уведомленията след като кликнете върху него (предварително:true)click {String}е пътят към методаfunction(obj, el)когато потребителят кликне върху уведомлениятаexec {String}е пътят към методаfunction(render(ARR_OF_OBJECT))когато потребителят иска да покаже уведомленията
Използвайте го с <ui-component name="notificationspanel">Когато компонентът все още не е зареден, jComponent Изтегляне на първия адрес в DEF.fallback (След това Componentator Източник: Питър Шерка Componentator Съставни съставки, лиценз на 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>