Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/choice-popover
Popover multiple choice component
https://github.com/stagas/choice-popover
Last synced: 14 days ago
JSON representation
Popover multiple choice component
- Host: GitHub
- URL: https://github.com/stagas/choice-popover
- Owner: stagas
- Created: 2012-08-18T19:37:04.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-18T19:38:44.000Z (about 12 years ago)
- Last Synced: 2024-04-08T15:44:33.709Z (7 months ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# Choice Popover
Popover choice component built on top of [Popover](http://github.com/component/popover).
## Features
- all the features of Popover / Tip
## Events
- `show` the confirmation is shown
- `hide` the confirmation is hidden
- `choice` the user made a choice
- also emits an event of the actual choice text## API
### new ChoicePopover(msg, [title], choices)
Create a new popover with `msg` and optional `title`.
```javascript
var choices = [ 'Yes, delete him!', 'Can\'t decide :(', '@No, leave him alone!' ];
var confirm = new Choice('This action cannot be undone.', 'Delete tobi?', choices);
confirm.show(el);
```### ChoicePopover#focus(choice)
Focus on that choice.
### ChoicePopover#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