An open API service indexing awesome lists of open source software.

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

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);
```