Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Confirmation notification component

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 Makefile
Octocat-spinner-32 Readme.md
Octocat-spinner-32 component.json
Octocat-spinner-32 index.js
Octocat-spinner-32 notification.css
Octocat-spinner-32 template.html
Octocat-spinner-32 template.js
Readme.md

ConfirmationNotification

Confirmation notification component with a clean slate to build off of.

js confirmation notification

Installation

$ component install component/confirmation-notification

Features

Events

  • close the notification is closed via the X
  • click the notification is clicked
  • cancel the user closed the notification or cancelled
  • ok the user accepted

Example

var notify = require('confirmation-notification');

notify('Accept friend request?', function(yes){
  alert(yes ? 'wahoo' : 'nope');
})

API

notify(msg, [fn])

Notify with the given msg and no title. If a function is given it will be invoked with a boolean representing the user's choice.

notify(title, msg, [fn])

Notify with the given msg and title. If a function is given it will be invoked with a boolean representing the user's choice.

.focus(type)

By default the "cancel" button is focused, however you may invoke .focus('ok').

.cancel(text)

Set cancel button text.

.ok(text)

Set cancel ok text.

.show([fn])

Show the notification and invoke fn with a boolean representing the user's choice.

When fn is omitted you may still utilize the cancel / ok events.

License

MIT

Something went wrong with that request. Please try again.