Copy environment

Browser Notification

<div class="notification  ">
    <div class="notification__content">
        You are using an outdated browser. Please upgrade your browser to improve your experience and security.
    </div>
    <div class="notification__action-list">

        <a href="https://google.com" class="button  notification__action  " target='_blank'>

            <span class="button__inner" data-text="Learn more">
                <span class="button__text">
                    Learn more

                </span>
            </span>
        </a>

        <button type="button" class="button button--white notification__action notification__action--close ">

            <span class="button__inner" data-text="OK">
                <span class="button__text">
                    OK

                </span>
            </span>
        </button>
    </div>
</div>
{% include '@notification' with { modifier: '', class: class, data: data } %}
{
  "language": "en-US",
  "data": {
    "content": "You are using an outdated browser. Please upgrade your browser to improve your experience and security.",
    "actions": [
      {
        "link": "https://google.com",
        "text": "Learn more",
        "attributes": "target='_blank'"
      }
    ],
    "button": {
      "text": "OK"
    }
  }
}
  • Content:
    import Notification, { INotification } from '@notification';
    import Helpers from '@helpers';
    
    export default class BrowserNotification extends Notification {
        static initSelector: string = '.browser-notification';
    
        public static get shouldShow(): boolean {
            const ieVer: number | boolean = Helpers.isIE;
    
            return window.sessionStorage.getItem('gotoandplay_old_browser') !== 'accepted' && ieVer && ieVer <= 11;
        }
    
        public static render(data: INotification, className: string = ''): JQuery {
            return super.render(data, ['browser-notification', className].join(' '));
        }
    
        remove(): void {
            window.sessionStorage.setItem('gotoandplay_old_browser', 'accepted');
    
            super.remove();
        }
    }
    
  • URL: /components/raw/browser-notification/browser-notification.ts
  • Filesystem Path: src/patterns/components/notifications/browser-notification/browser-notification.ts
  • Size: 739 Bytes
  • Handle: @browser-notification--default
  • Filesystem Path: src/patterns/components/notifications/browser-notification/browser-notification.twig
  • References (1): @notification