Skip to content
No description or website provided.
CoffeeScript CSS JavaScript HTML Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
dist
scripts
spec/dash_banner
styles
.bowerrc
.gitignore
.travis.yml
CHANGELOG.md
Gruntfile.js
LICENSE.md
README.md
bower.json
bower_deploy.sh
package.json Add styling to the dash-banner component
testem.json

README.md

Dash Banner

Build Status

This is the alert banner for the Dash platform.

Dependencies

  • Samaritan CSS
    • flash
    • icons
  • An element with data-id=dash-banner-container

Releasing a New Version

Steps to release a new version:

  1. Update the change log.
  2. Run ./bower_deploy.sh

Setup

  • install node/npm
  • npm install
  • bower install
  • npm install testem -g

Tests

Run testem

Usage

Dash Banner requires an element with data-id=dash-banner-container on the page.

Success Example

DashBanner.View.showSuccess("Some Success Message")
DashBanner.View.flashSuccess("Some Success Message")

flashSuccess automatically closes the Banner after 3 sec

Error Example

DashBanner.View.showError("Some Error Message")
DashBanner.View.flashError("Some Error Message")

flashError automatically closes the Banner after 3 sec

Action Example

DashBanner.View.showAction("Some Action Message", "custom-status")
DashBanner.View.flashAction("Some Action Message", "custom-status")

flashaction automatically closes the Banner after 3 sec showAction can also be used to attach the Banner to a custom container:

DashBanner.View.showAction("Some Action Message", "custom-status", $('.custom-container'))

When used in this way the custom container must also be passed to closeBanner:

DashBanner.View.closeBanner($('.custom-container'))

Closing the Banner

When using showSuccess, showError, or showAction the Banner must be manually closed

DashBanner.View.closeBanner()

When showAction is given a custom container, the custom container must also be passed to closeBanner

DashBanner.View.showAction("Some Action Message", "custom-status", $('.custom-container'))
DashBanner.View.closeBanner($('.custom-container'))

Running the sample

  1. run testem
  2. open app/index.html

License

MIT License

Something went wrong with that request. Please try again.