Notification

    With Notification component you can show required messages that looks like Push (or Local) system notifications.

    Let’s look at related App methods to work with Notification:

    app.notification.create(parameters)- create Notification instance

    • parameters - object. Object with notification parameters

    Method returns created Notification’s instance

    app.notification.destroy(el)- destroy Notification instance

    • el - HTMLElement or string (with CSS Selector) or object. Notification element or Notification instance to destroy.

    Method returns Notification’s instance

    app.notification.open(el, animate)- opens Notification

    • el - HTMLElement or string (with CSS Selector). Notification element to open.
    • animate - boolean. Open Notification with animation.

    Method returns Notification’s instance

    app.notification.close(el, animate)- closes Notification

    • el - HTMLElement or string (with CSS Selector). Notification element to close.
    • animate - boolean. Close Notification with animation.

    Method returns Notification’s instance

    Note that all following parameters can be used in global app parameters under property to set defaults for all notifications. For example:

    So to create Notification we have to call:

    After that we have its initialized instance (like variable in example above) with useful methods and properties:

    Notification will fire the following DOM events on notification element and events on app and notification instance:

    App and Notification Instance Events

    Notification instance emits events on both self instance and app instance. App instance events has same names prefixed with .