Skip to content

Commit 6a66797

Browse files
authored
fix(ui5-li-notification-group): fixed close button functionality in shell bar sample (#4408)
Fixed samples when ui5-li-notification-group is used in shellbar. The close button functionality now works Fixes #4202
1 parent 912a09e commit 6a66797

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

packages/fiori/test/pages/NotificationListGroupItem.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,17 +293,17 @@ <h3>Events on ui5-list level</h3>
293293
</div>
294294

295295
<script>
296-
notificationList.addEventListener("itemClick", function(event) {
296+
notificationList.addEventListener("item-click", function(event) {
297297
wcToastBS.textContent = event.detail.item.titleText;
298298
wcToastBS.show();
299299
});
300300

301-
notificationList.addEventListener("itemClose", function(event) {
301+
notificationList.addEventListener("item-close", function(event) {
302302
wcToastBS.textContent = event.detail.item.titleText;
303303
wcToastBS.show();
304304
});
305305

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

334334

335335

336-
shellbar.addEventListener("ui5-notificationsClick", function(event) {
336+
shellbar.addEventListener("ui5-notifications-click", function(event) {
337337
event.preventDefault();
338338
notificationsPopover.showAt(event.detail.targetRef);
339339
});
340+
341+
notificationListTop.addEventListener("item-close", function (event) {
342+
wcToastBS.textContent = event.detail.item.titleText;
343+
wcToastBS.show();
344+
});
340345
</script>
341346
</body>
342347
</html>

packages/fiori/test/pages/NotificationListItem.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,17 @@ <h3>Events on ui5-list level</h3>
247247
</div>
248248

249249
<script>
250-
notificationList.addEventListener("itemClick", function(event) {
250+
notificationList.addEventListener("item-click", function(event) {
251251
wcToastBS.textContent = event.detail.item.titleText;
252252
wcToastBS.show();
253253
});
254254

255-
notificationList.addEventListener("itemClose", function(event) {
255+
notificationList.addEventListener("item-close", function(event) {
256256
wcToastBS.textContent = event.detail.item.titleText;
257257
wcToastBS.show();
258258
});
259259

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

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

273-
notificationList2.addEventListener("itemClose", function(event) {
273+
notificationList2.addEventListener("item-close", function(event) {
274274
wcToastBS.textContent = event.detail.item.titleText;
275275
wcToastBS.show();
276276
});
@@ -299,7 +299,7 @@ <h3>Events on ui5-list level</h3>
299299
notificationsPopover.showAt(openNotifications);
300300
});
301301

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

packages/fiori/test/samples/NotificationListGroupItem.sample.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ <h3>NotificationListGroupItem In ShellBar</h3>
309309
event.preventDefault();
310310
notificationsPopover.showAt(event.detail.targetRef);
311311
});
312+
313+
notificationListTop.addEventListener("item-close", function (e) {
314+
e.detail.item.hidden = true;
315+
});
312316
</script>
313317
</div>
314318
<pre class="prettyprint lang-html"><xmp>
@@ -358,6 +362,7 @@ <h3>NotificationListGroupItem In ShellBar</h3>
358362
shellbar.addEventListener("notifications-click", function(event) {
359363
notificationsPopover.showAt(event.detail.targetRef);
360364
});
365+
361366
</script>
362367

363368
</xmp></pre>

0 commit comments

Comments
 (0)