Skip to content

pirxpilot/confirmation-popover

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Confirmation Popover

Popover confirmation component built on top of Popover.

js popover confirmation component

Live demo is here.

Installation

Install with npm:

$ npm install @pirxpilot/confirmation-popover

Features

  • all the features of Popover / Tip

Events

  • show the confirmation is shown
  • hide the confirmation is hidden
  • cancel the user closed the confirmation or cancelled
  • ok the user accepted

API

new ConfirmationPopover(msg, [title])

Create a new popover with msg and optional title.

var Confirmation = require('confirmation-popover');
var confirm = new Confirmation('This action cannot be undone.', 'Delete tobi?');
confirm.show(el);

.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(el, [fn])

Attach to el, and invoke fn with a boolean representing the user's choice.

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

...

View Tip and Popover for additional API documentation.

License

MIT

About

Confirmation Popover for inline confirmations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 54.8%
  • HTML 26.3%
  • Makefile 13.6%
  • CSS 5.3%