Skip to content

Commit

Permalink
Fix issue 2293: click on read notification focus bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminapetersen committed Oct 19, 2017
1 parent a7bc1f0 commit 4286cae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/styles/_notifications.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ notification-drawer-wrapper {
}
// the whole block is clickable, need to set pointer on all of these
// for the correct visual
.drawer-pf-notification,
.drawer-pf-notification-info,
.drawer-pf-notification-message {
.drawer-pf-notification-inner.is-clickable,
.is-clickable .drawer-pf-notification-info,
.is-clickable .drawer-pf-notification-message {
cursor: pointer;
}
.drawer-pf-notification {
Expand Down
13 changes: 10 additions & 3 deletions app/views/directives/notifications/notification-body.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div
class="drawer-pf-notification-inner"
tabindex="0"
ng-click="$ctrl.customScope.markRead(notification)">
ng-class="{ 'is-clickable': notification.unread }"
ng-click="notification.unread && $ctrl.customScope.markRead(notification)">
<button
class="btn btn-link pull-right drawer-pf-notification-close"
type="button"
Expand Down Expand Up @@ -88,7 +88,14 @@
<span ng-if="!$last" class="toast-action-divider">|</span>
</span>
</span>

<span class="sr-only">Message Unread. </span>
<a
ng-if="notification.unread"
href=""
class="sr-only sr-only-focusable"
ng-click="$ctrl.customScope.markRead(notification)">
<span>Mark Read</span>
</a>
</div>
<div
ng-if="notification.event.count > 1"
Expand Down
6 changes: 5 additions & 1 deletion dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -7785,7 +7785,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(


$templateCache.put('views/directives/notifications/notification-body.html',
"<div class=\"drawer-pf-notification-inner\" tabindex=\"0\" ng-click=\"$ctrl.customScope.markRead(notification)\">\n" +
"<div class=\"drawer-pf-notification-inner\" ng-class=\"{ 'is-clickable': notification.unread }\" ng-click=\"notification.unread && $ctrl.customScope.markRead(notification)\">\n" +
"<button class=\"btn btn-link pull-right drawer-pf-notification-close\" type=\"button\" ng-if=\"!notification.actions.length\" ng-click=\"$ctrl.customScope.clear(notification, $index, notificationGroup)\">\n" +
"<span class=\"sr-only\">Clear notification</span>\n" +
"<span aria-hidden=\"true\" class=\"pficon pficon-close\"></span>\n" +
Expand Down Expand Up @@ -7825,6 +7825,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<span ng-if=\"!$last\" class=\"toast-action-divider\">|</span>\n" +
"</span>\n" +
"</span>\n" +
"<span class=\"sr-only\">Message Unread. </span>\n" +
"<a ng-if=\"notification.unread\" href=\"\" class=\"sr-only sr-only-focusable\" ng-click=\"$ctrl.customScope.markRead(notification)\">\n" +
"<span>Mark Read</span>\n" +
"</a>\n" +
"</div>\n" +
"<div ng-if=\"notification.event.count > 1\" class=\"text-muted small\">\n" +
"{{notification.event.count}} times in the last\n" +
Expand Down
2 changes: 1 addition & 1 deletion dist/styles/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4286cae

Please sign in to comment.