Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/confirmation-popover
Confirmation Popover for inline confirmations
https://github.com/component/confirmation-popover
Last synced: 13 days ago
JSON representation
Confirmation Popover for inline confirmations
- Host: GitHub
- URL: https://github.com/component/confirmation-popover
- Owner: component
- Created: 2012-08-06T19:40:14.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-02-07T23:45:22.000Z (almost 9 years ago)
- Last Synced: 2024-05-08T17:12:32.346Z (8 months ago)
- Language: JavaScript
- Homepage: http://component.github.io/confirmation-popover
- Size: 38.1 KB
- Stars: 12
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# Confirmation Popover
Popover confirmation component built on top of [Popover](http://github.com/component/popover).
![js popover confirmation component](http://f.cl.ly/items/2H3a3C1M1k071z1B360I/Screen%20Shot%202012-08-06%20at%2012.16.59%20PM.png)
Live demo is [here](http://component.github.io/confirmation-popover/).
## Installation
```
$ component install component/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`.
```js
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](http://github.com/component/tip) and [Popover](http://github.com/component/popover) for additional
API documentation.## License
MIT