https://github.com/gwendall/meteor-modal
Lightweight modals for Meteor
https://github.com/gwendall/meteor-modal
Last synced: 2 months ago
JSON representation
Lightweight modals for Meteor
- Host: GitHub
- URL: https://github.com/gwendall/meteor-modal
- Owner: gwendall
- Created: 2015-07-02T13:06:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-23T13:39:26.000Z (almost 10 years ago)
- Last Synced: 2025-03-18T05:56:56.126Z (3 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Meteor Modal
================Lightweight modal for Meteor.
Installation
------------``` sh
meteor add gwendall:modal
```How to use
----------**Show a modal**
- DOM approach
``` html
Show modal
```- JS approach
``` javascript
Modal.show({
template: templateName, // Name of the template to use in the modal
class: class, // class of the modal
data: data, // data to be passed to the modal
collection: collection, // collection to fetch a doc from
doc: doc // id of the doc to be passed to the modal template, if collection is also passed
});
```**Hide a modal**
- DOM approach
``` html
Hide modal
```- JS approach
``` javascript
Modal.hide();
```**Show hooks**
``` javascript
Modal.onShow(templateName, hook);
```**Hide hooks**
``` javascript
Modal.onHide(templateName, hook);
```