Skip to content

Commit

Permalink
Merge pull request #255 from dwmkerr/build/release-0.8
Browse files Browse the repository at this point in the history
docs: cleanup README, prep 0.8 release notes
  • Loading branch information
dwmkerr authored Nov 10, 2018
2 parents f45e0b1 + ccb47be commit 6c457e7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.8.0

* Support for a globally configurable close timeout. Thanks [decherneyge](https://github.com/decherneyge).
* Support for selector for `appendElement`. Thanks [decherneyge](https://github.com/decherneyge).
* Tooling version updates.

## v0.7.12

* Support for configuration of the `$locationChangeSuccess` event. Thanks [smalbs](https://github.com/smalbs).
Expand Down
44 changes: 31 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@

Modal service for AngularJS - supports creating popups and modals via a service. See [a quick fiddle](http://jsfiddle.net/dwmkerr/8MVLJ/) or a full set of samples at [dwmkerr.github.io/angular-modal-service](http://dwmkerr.github.io/angular-modal-service).

1. [Usage](#usage)
2. [Developing](#developing)
3. [Tests](#tests)
4. [FAQ & Troubleshooting](#faq)
5. [Thanks](#thanks)

<!-- vim-markdown-toc GFM -->

* [Usage](#usage)
* [ShowModal Options](#showmodal-options)
* [The Modal Object](#the-modal-object)
* [The Modal Controller](#the-modal-controller)
* [Closing All Modals](#closing-all-modals)
* [Animation](#animation)
* [Error Handing](#error-handing)
* [Global Options Configuration](#global-options-configuration)
* [Developing](#developing)
* [Tests](#tests)
* [Releasing](#releasing)
* [FAQ](#faq)
* [Thanks](#thanks)

<!-- vim-markdown-toc -->

## Usage

Expand Down Expand Up @@ -126,8 +139,10 @@ ModalService.showModal({
},
controllerAs : "futurama"
})

```
#### ShowModal Options

### ShowModal Options

The `showModal` function takes an object with these fields:

Expand All @@ -144,7 +159,7 @@ The `showModal` function takes an object with these fields:
* `preClose`: Optional. A function which will be called before the process of closing a modal starts. The signature is `function preClose(modal, result, delay)`. It is provided the `modal` object, the `result` which was passed to `close` and the `delay` which was passed to close.
* `locationChangeSuccess`: Optional. Allows the closing of the modal when the location changes to be configured. If no value is set, the modal is closed immediately when the `$locationChangeSuccess` event fires. If `false` is set, event is not fired. If a number `n` is set, then the event fires after `n` milliseconds.

#### The Modal Object
### The Modal Object

The `modal` object returned by `showModal` has this structure:

Expand All @@ -156,7 +171,7 @@ The `modal` object returned by `showModal` has this structure:
* `modal.close` - A promise which is resolved when the modal `close` function is called.
* `modal.closed` - A promise which is resolved once the modal has finished animating out of the DOM.

#### The Modal Controller
### The Modal Controller

The controller that is used for the modal always has one extra parameter injected, a function
called `close`. Call this function with any parameter (the result). This result parameter is
Expand Down Expand Up @@ -216,7 +231,9 @@ ModalService.showModal({
```

### Global Options Configuration

To configure the default options that will apply to all modals call `configureOptions` on the `ModalServiceProvider`.

```js
app.config(["ModalServiceProvider", function(ModalServiceProvider) {

Expand Down Expand Up @@ -273,7 +290,7 @@ To create a release:

Having problems? Check this FAQ first.

#### I'm using a Bootstrap Modal and the backdrop doesn't fade away
**I'm using a Bootstrap Modal and the backdrop doesn't fade away**

This can happen if your modal template contains more than one top level element.
Imagine this case:
Expand All @@ -295,7 +312,7 @@ It will try and make both elements into a modal. This means both elements will g
In this case, either remove the extra elements, or find the specific element you need
from the provided `modal.element` property.

#### The backdrop STILL does not fade away after I call `close` OR I don't want to use the 'data-dismiss' attribute on a button, how can I close a modal manually?
**The backdrop STILL does not fade away after I call `close` OR I don't want to use the 'data-dismiss' attribute on a button, how can I close a modal manually?**

You can check the 'Complex' sample ([complexcontroller.js](samples/complex/complexcontroller.js)). The 'Cancel' button closes without using the `data-dismiss` attribute. In this case, just use the `preClose` option to ensure the bootstrap modal is removed:

Expand Down Expand Up @@ -329,7 +346,7 @@ app.controller('ExampleModalController', [
}]);
```

#### I'm using a Bootstrap Modal and the dialog doesn't show up
**I'm using a Bootstrap Modal and the dialog doesn't show up**

Code is entered exactly as shown the example but when the showAModal() function fires the modal template html is appended to the body while the console outputs:

Expand All @@ -339,7 +356,7 @@ TypeError: undefined is not a function

Pointing to the code: `modal.element.modal();`. This occurs if you are using a Bootstap modal but have not included the Bootstrap JavaScript. The recommendation is to include the modal JavaScript before AngularJS.

#### How can I prevent a Bootstrap modal from being closed?
**How can I prevent a Bootstrap modal from being closed?**

If you are using a bootstrap modal and want to make sure that only the `close` function will close the modal (not a click outside or escape), use the following attributes:

Expand All @@ -366,7 +383,7 @@ ModalService.showModal({

Thanks [lindamarieb](https://github.com/lindamarieb) and [ledgeJumper](https://github.com/ledgeJumper)!

#### Problems with Nested Modals
**Problems with Nested Modals**

If you are trying to nest Bootstrap modals, you will run into issues. From Bootstrap:

Expand All @@ -389,3 +406,4 @@ Thanks go the the following contributors:
* [kernowjoe](https://github.com/kernowjoe) - Robustness around locationChange
* [arthur-xavier](https://github.com/arthur-xavier) - Robustness when `body` element changes.
* [stormpooper](https://github.com/StormPooper) - The new `bodyClass` feature.
* [decherneyge](https://github.com/decherneyge) - Provider features, global configuration, `appendElement` improvements.
4 changes: 2 additions & 2 deletions dst/angular-modal-service.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dst/angular-modal-service.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c457e7

Please sign in to comment.