# mwyatt-dialogue

> Simple, light and flexible js dialogue. http://mwyatt.github.io/dialogue/

Latest version **0.7.0** (published 2017-04-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install mwyatt-dialogue
pnpm add mwyatt-dialogue
yarn add mwyatt-dialogue
bun add mwyatt-dialogue
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2017-04-29 |
| First published | 2016-02-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Martin Wyatt |
| Maintainers | mwyatt |

## Links

- npm: https://www.npmjs.com/package/mwyatt-dialogue
- Repository: https://github.com/mwyatt/dialogue
- Homepage: https://github.com/mwyatt/dialogue#readme
- Issues: https://github.com/mwyatt/dialogue/issues
- npm.io page: https://npm.io/package/mwyatt-dialogue

## Dependencies (6)

- [extend](https://npm.io/package/extend.md) 3.0.0
- [domready](https://npm.io/package/domready.md) 1.0.8
- [mustache](https://npm.io/package/mustache.md) 2.2.1
- [draggable](https://npm.io/package/draggable.md) 4.0.4
- [stringify](https://npm.io/package/stringify.md) 5.1.0
- [browserify](https://npm.io/package/browserify.md) 11.2.0

## Recent versions

- 0.7.0 (latest) — 2017-04-29
- 0.6.3 — 2016-10-05
- 0.6.2 — 2016-10-05
- 0.6.1 — 2016-07-27
- 0.6.0 — 2016-07-27
- 0.5.3 — 2016-06-23
- 0.5.2 — 2016-06-20
- 0.5.1 — 2016-06-20
- 0.5.0 — 2016-06-20
- 0.4.4 — 2016-06-17
- 0.4.3 — 2016-06-17
- 0.4.2 — 2016-06-17
- 0.4.1 — 2016-06-17
- 0.4.0 — 2016-06-17
- 0.3.0 — 2016-06-13
- … 11 more at https://npm.io/package/mwyatt-dialogue/versions

## README

[![Build Status](https://travis-ci.org/mwyatt/dialogue.png?branch=master)](https://travis-ci.org/mwyatt/dialogue)

# Demo
Simple, light and flexible js dialogue.
http://mwyatt.github.io/dialogue/
# Installation
```bash
npm install mwyatt-dialogue --save
```
```javascript
var dialogueFactory = require('mwyatt-dialogue');
var dialogue = new dialogueFactory();

dialogue.create({
  title: 'Hello World'
});
```
## Options
| Property | Value |
| --- | --- |
| `title` | `string` Gives the dialogue a title. |
| `description` | `string` Gives the dialogue a description. |
| `hardClose` | `bool` `default: false` If true, only clicking the cross in the corner will close the dialogue. |
| `className` | `string` Appends the class name string to the dialogue when rendering. This allows for unique styling within specific dialogues. |
| `positionTo` | `object` Pass a jquery selection here and the dialogue will be positioned to it when it opens. |
| `draggable` | `bool` `default: false` If true, makes the dialogue draggable. |
| `actions` | Specify any buttons required for the dialogue and the callback functions which will execute when clicked. `actions: {'Name': function() {}}` |
| `ajax` | `bool` `default: false` If true, the dialogue is created with a CSS spinner in the body. The ajax request must be handled separately. |
| `onComplete` | `function` Callback function, fired when dialogue has been fully rendered and positioned. |
| `onClose` | `function` Fired when dialogue has been closed. |
| `mask` | `bool` `default: false` If true, the browser view port is masked/obscured slightly. |
| `html` | `string` Insert html directly into the dialogue. |
| `hideClose` | `bool` `default: false` If true, hides the closing cross from the corner. |
| `width` | `integer` Integer specifying exact pixel width for dialogue. |
## Methods
Various methods can be called upon once the dialogue is created.
```javascript
dialogue.close();
```
| Method | Action |
| --- | --- |
| `close` | Closes the dialogue and removes any events. |
| `setHtml` | `string` Replaces the html area with the passed string. |
| `setTitle` | `string` Replaces the title area with the passed string. |
| `reposition` | Centers the dialogue in the viewport. |
| `isOpen` | `returns bool` Returns true if the dialogue is curerntly open.  |

---
_Source: https://npm.io/package/mwyatt-dialogue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
