Skip to content

Commit

Permalink
fix(ui5-li-notification-group): fixed close button functionality in s…
Browse files Browse the repository at this point in the history
…hell bar sample (#4408)

Fixed samples when ui5-li-notification-group is used in shellbar. The close button functionality now works

Fixes #4202
  • Loading branch information
kskondov authored Dec 13, 2021
1 parent 912a09e commit 6a66797
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
13 changes: 9 additions & 4 deletions packages/fiori/test/pages/NotificationListGroupItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,17 @@ <h3>Events on ui5-list level</h3>
</div>

<script>
notificationList.addEventListener("itemClick", function(event) {
notificationList.addEventListener("item-click", function(event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});

notificationList.addEventListener("itemClose", function(event) {
notificationList.addEventListener("item-close", function(event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});

notificationList.addEventListener("itemToggle", function(event) {
notificationList.addEventListener("item-toggle", function(event) {
var item = event.detail.item;
wcToastBS.textContent = item.titleText + " has been " + (item.collapsed ? "collapsed" : "expanded");
wcToastBS.show();
Expand Down Expand Up @@ -333,10 +333,15 @@ <h3>Events on ui5-list level</h3>



shellbar.addEventListener("ui5-notificationsClick", function(event) {
shellbar.addEventListener("ui5-notifications-click", function(event) {
event.preventDefault();
notificationsPopover.showAt(event.detail.targetRef);
});

notificationListTop.addEventListener("item-close", function (event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});
</script>
</body>
</html>
10 changes: 5 additions & 5 deletions packages/fiori/test/pages/NotificationListItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,17 @@ <h3>Events on ui5-list level</h3>
</div>

<script>
notificationList.addEventListener("itemClick", function(event) {
notificationList.addEventListener("item-click", function(event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});

notificationList.addEventListener("itemClose", function(event) {
notificationList.addEventListener("item-close", function(event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});

notificationList2.addEventListener("itemClick", function(event) {
notificationList2.addEventListener("item-click", function(event) {
var item = event.detail.item;

setTimeout(function() {
Expand All @@ -270,7 +270,7 @@ <h3>Events on ui5-list level</h3>
wcToastBS.show();
});

notificationList2.addEventListener("itemClose", function(event) {
notificationList2.addEventListener("item-close", function(event) {
wcToastBS.textContent = event.detail.item.titleText;
wcToastBS.show();
});
Expand Down Expand Up @@ -299,7 +299,7 @@ <h3>Events on ui5-list level</h3>
notificationsPopover.showAt(openNotifications);
});

shellbar.addEventListener("ui5-notificationsClick", function(event) {
shellbar.addEventListener("ui5-notifications-click", function(event) {
event.preventDefault();
notificationsPopover.showAt(event.detail.targetRef);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ <h3>NotificationListGroupItem In ShellBar</h3>
event.preventDefault();
notificationsPopover.showAt(event.detail.targetRef);
});

notificationListTop.addEventListener("item-close", function (e) {
e.detail.item.hidden = true;
});
</script>
</div>
<pre class="prettyprint lang-html"><xmp>
Expand Down Expand Up @@ -358,6 +362,7 @@ <h3>NotificationListGroupItem In ShellBar</h3>
shellbar.addEventListener("notifications-click", function(event) {
notificationsPopover.showAt(event.detail.targetRef);
});

</script>

</xmp></pre>
Expand Down

0 comments on commit 6a66797

Please sign in to comment.