Skip to content

definitions

Mat Owens edited this page Aug 7, 2015 · 1 revision

Definitions

###Methods

####set(message, type) displays a notification message and sets the formatting/behavioral options for this one notification.

  • message: string - required - the message to display in your notification.
  • type: string - optional - the type of notification to display.
    • info (default)
    • error
    • success
    • warn
    • grimace

####config(options) sets default settings for all notifications to take into account when displaying.

  • options - object - an object of options that overrides the default settings.
    • theme: string - optional - sets the theme to use, altering the styles for each notification type.
      • pure (default)
      • prime
      • pastel
      • pitchy
    • type: string - optional - sets the default notification type when a type isn't explicitly set.
      • info (default)
      • error
      • success
      • warn
      • grimace
    • position: string - optional - sets where the notifications will be displayed at in the app.
      • bottom (default)
      • top
    • duration: integer - optional - the duration the notification stays visible to the user, in milliseconds.
    • sticky: bool - optional - determines whether or not the message will fade at the end of the duration or if the message will persist until the user dismisses it themselves. when true, duration will not be set, even if it has a value. (false by default).

####dismiss() manually dismisses any sticky notifications that may still be set.

####addType(name, class) allows a dev to create a new type of notification to use in their app.

  • name: string - required - the name used to trigger this notification type in the set method.
  • class: string - required - the class used to target this type in the stylesheet.

####addTheme(name, class) allows a dev to create a whole new set of styles for each notification type.

  • name: string - required - the name used when setting the theme in the config object.
  • class: string - required - the class used to target this theme in the stylesheet.

###Styles

  • primary: the class that's present on every notification and controls all of the primary styles.

    • .ngn
  • position: purely responsible for where notifications are displayed. default is set to bottom, one is present on every notification.

    • .ngn-top
    • .ngn-bottom
  • types: default classes for setting each notification type's background color. default is set to info, one is present on every notification.

    • .ngn-info
    • .ngn-error
    • .ngn-success
    • .ngn-warn
    • .ngn-grimace
  • themes: theme specific classes that are chained together with type classes to override default background colors. not always present, default excludes all of these.

    • .ngn-prime
    • .ngn-pastel
    • .ngn-pitchy
  • sticky: styles responsible for displaying the dismissal button for sticky notifications.

    • .ngn-sticky - displays the dismissal button when sticky is enabled.
    • .ngn-dismiss - styles the dismissal button.

Overview

Implementation

  • Requirements
  • Installation
  • Usage

Advanced Usage

  • Default Configuration
  • Individual Configurations
  • Sticky Notifications
  • HTML Notifications
  • Roll Your Own
    • Custom Notification Types
    • Custom Themes
    • Custom Styles

Definitions

  • Methods
  • Styles

Development

  • Contributing
  • Testing
Clone this wiki locally