diff --git a/src/components/notification/notification.component.css b/src/components/notification/notification.component.css index cf24e66..4a21839 100644 --- a/src/components/notification/notification.component.css +++ b/src/components/notification/notification.component.css @@ -22,6 +22,7 @@ font-size: 20px; } + .simple-notification .sn-content { font-size: 16px; line-height: 20px; @@ -34,6 +35,11 @@ line-height: 20px; } +.simple-notification.has-icon .sn-title, +.simple-notification.has-icon .sn-content { + padding: 0 50px 0 0; +} + .simple-notification .icon { position: absolute; box-sizing: border-box; @@ -68,8 +74,8 @@ direction: rtl; } -.simple-notification.rtl-mode .sn-content { - padding: 0 0 0 50px; +.simple-notification.rtl-mode { + direction: rtl; } .simple-notification.rtl-mode svg { diff --git a/src/components/notification/notification.component.html b/src/components/notification/notification.component.html index 641c644..4d06b44 100644 --- a/src/components/notification/notification.component.html +++ b/src/components/notification/notification.component.html @@ -9,7 +9,8 @@ 'success': item.type === 'success', 'info': item.type === 'info', 'bare': item.type === 'bare', - 'rtl-mode': rtl + 'rtl-mode': rtl, + 'has-icon': item.icon || (item.icon && item.icon !== 'bare') }" (mouseenter)="onEnter()" (mouseleave)="onLeave()"> @@ -32,7 +33,7 @@
-
+
diff --git a/src/components/notification/notification.component.ts b/src/components/notification/notification.component.ts index adc0df7..b3b3037 100644 --- a/src/components/notification/notification.component.ts +++ b/src/components/notification/notification.component.ts @@ -196,7 +196,7 @@ export class NotificationComponent implements OnInit, OnDestroy { onClick($e: MouseEvent): void { this.item.click!.emit($e); - if (this.clickToClose) { + if (this.clickToClose && !this.clickIconToClose) { this.remove(); } } diff --git a/src/services/notifications.service.ts b/src/services/notifications.service.ts index 635963c..0de1253 100644 --- a/src/services/notifications.service.ts +++ b/src/services/notifications.service.ts @@ -13,6 +13,7 @@ export class NotificationsService { set(notification: Notification, to: boolean): Notification { notification.id = notification.override && notification.override.id ? notification.override.id : Math.random().toString(36).substring(3); notification.click = new EventEmitter<{}>(); + notification.clickIcon = new EventEmitter<{}>(); notification.timeoutEnd = new EventEmitter<{}>(); this.emitter.next({command: 'set', notification: notification, add: to});