Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
* development:
  Updated version numbers
  Removed debugger
  Updated installation instructions
  Updated installation instructions
  Updated installation instructions
  Added changelog entry for strict mode
  Added strict mode
  Fixed typos in readme
  Added prefix option to JS; updated changelog and readme
  Updated changelog; fixed modal backdrop animations; cleaned up Sass source
  Started adding build scripts for 2.0.1
  • Loading branch information
kevinberonilla committed Aug 28, 2017
2 parents 039be8b + caae06b commit 5f5701e
Show file tree
Hide file tree
Showing 11 changed files with 1,287 additions and 191 deletions.
20 changes: 14 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# jQuery Quick Modal

#### v2.1.0 | August 28, 2017
* Fixed an issue where modal backdrops were not animating properly when closing a modal
* Added the `prefix` option to support builds with custom prefixes
* Added Sass source files and Gulp tasks to support builds with custom prefixes
* The plugin now runs in strict mode

---

#### v2.0.0 | August 22, 2017
* Updated all HTML classes and ids to use the `qm-` prefix
* Updated all events to use the `.qm` namespace
Expand All @@ -15,14 +23,14 @@
---

#### v1.07 | October 5, 2015
* Added the **onOpen** and **onClose** options
* Added the `onOpen` and `onClose` options
* Fixed an issue where the close modal bindings persisted after unbinding
* Code cleanup for maintainability

---

#### v1.06 | September 30, 2015
* Added the **appendBackgroundTo** option
* Added the `appendBackgroundTo` option
* Fixed an issue where two modal backgrounds could be appended through a specific combination of bindings

---
Expand All @@ -33,7 +41,7 @@
---

#### v1.04 | August 3, 2015
* Added the **enableBodyScroll** option
* Added the `enableBodyScroll` option

---

Expand All @@ -43,16 +51,16 @@
---

#### v1.02 | July 22, 2015
* Added the **enableEsc** and **enableClickAway** options
* Added the **trigger** method
* Added the `enableEsc` and `enableClickAway` options
* Added the `trigger` method
* Fixed an issue where modals taller than the viewport were not scrolling correctly

---

#### v1.01 | July 14, 2015
* Added method functionality
* Fixed an issue where the close modal selector was not binding correctly
* Added a min-height CSS property on the **.modal** class (fixes the appearance of empty modals)
* Added a min-height CSS property on the `.modal` class (fixes the appearance of empty modals)

---

Expand Down
100 changes: 55 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jQuery 1.7.0 or higher
---

#### Installation
Download the plugin via Bower or manually copy the CSS and JS files to your site, then include them in the `<head>` tag. Be sure to reference the JS after jQuery.
Download the plugin via Bower or manually copy the CSS and JS files to your site, then include them in the `<head>` tag.
```
bower install jquery-quick-modal
```
Expand All @@ -33,16 +33,16 @@ bower install jquery-quick-modal
<a href="#" class="qm-close-modal">Close window</a>
</div>
```
**class="open-modal"**
**`class="open-modal"`**
The class for the element which will trigger a modal window on click; can be changed to a selector of your choice when initialized; default class is not styled by CSS

**data-modal-id="my-modal"**
**`data-modal-id="my-modal"`**
Specifies the ID of the modal that the link will be bound to; required (throws an error if not present)

**class="qm-modal"**
**`class="qm-modal"`**
The class for the modal window; has CSS styles that can be edited/overridden

**class="qm-close-modal"**
**`class="qm-close-modal"`**
The class for the element which will close an opened modal window on click; has CSS styles that can be edited/overridden; can be changed to a selector of your choice when initialized (loses CSS styles when done so)

---
Expand All @@ -53,7 +53,7 @@ $(document).ready(function() {
$('.open-modal').quickModal();
});
```
**$('.open-modal')**
**`$('.open-modal')`**
The jQuery selector object assigned to trigger modal windows on click

---
Expand All @@ -70,55 +70,59 @@ $(document).ready(function() {
enableClickAway: true,
enableBodyScroll: false,
appendBackgroundTo: 'body',
prefix: 'qm',
onOpen: function() {},
onClose: function() {}
});
});
```
**animation**
**`animation`**
The type of animation used for opening and closing modal windows
* 'fade'
* 'fade-up'
* 'fade-right'
* 'fade-down'
* 'fade-left'
* 'fade-zoom'
* 'fade-zoom-up'
* 'fade-zoom-right'
* 'fade-zoom-down'
* 'fade-zoom-left'

**speed**
* `'fade'`
* `'fade-up'`
* `'fade-right'`
* `'fade-down'`
* `'fade-left'`
* `'fade-zoom'`
* `'fade-zoom-up'`
* `'fade-zoom-right'`
* `'fade-zoom-down'`
* `'fade-zoom-left'`

**`speed`**
The length of time (in milliseconds) for the animation

**timing**
**`timing`**
The timing function used to animate the modal window
* 'linear'
* 'ease'
* 'ease-in'
* 'ease-out'
* 'ease-in-out'
* 'cubic-bezier(n, n, n, n)'

**closeModalSelector**
* `'linear'`
* `'ease'`
* `'ease-in'`
* `'ease-out'`
* `'ease-in-out'`
* `'cubic-bezier(n, n, n, n)'`

**`closeModalSelector`**
The jQuery selector assigned to closing modal windows on click

**enableEsc**
**`enableEsc`**
Boolean for determining whether or not pressing the Esc key will close modals

**enableClickAway**
**`enableClickAway`**
Boolean for determining whether or not clicking the modal background will close modals

**enableBodyScroll**
**`enableBodyScroll`**
Boolean for determining whether or not the body behind an open modal window is scrollable

**appendBackgroundTo**
**`appendBackgroundTo`**
The jQuery selector to which the modal background will be appended

**onOpen**
**`prefix`**
String representing the prefix used for all classes and ids (only needed for builds with custom prefixed CSS; does not directly affect `closeModalSelector`)

**`onOpen`**
The callback that fires when the modal is opened

**onClose**
**`onClose`**
The callback that fires when the modal is closed

---
Expand Down Expand Up @@ -151,28 +155,28 @@ $(document).ready(function() {
});
});
```
**$('#my-modal')**
**`$('#my-modal')`**
The jQuery selector object for the modal window to be triggered

**$('#modal-link')**
**`$('#modal-link')`**
The jQuery selector object for the element that will trigger its modal window

**.quickModal('open')**
**`.quickModal('open')`**
Open the selected modal window with default settings

**.quickModal('open', {...})**
**`.quickModal('open', {...})`**
Open the selected modal window with the specified settings

**.quickModal('close')**
**`.quickModal('close')`**
Close the selected modal window with previously applied settings

**.quickModal('close', {...})**
**`.quickModal('close', {...})`**
Close the selected modal window with the specified settings

**.quickModal('trigger')**
**`.quickModal('trigger')`**
Open the target of the selected element with default settings

**.quickModal('trigger', {...})**
**`.quickModal('trigger', {...})`**
Open the target of the selected element with the specified settings

---
Expand All @@ -188,10 +192,10 @@ $(document).ready(function() {
});
});
```
**'modalopen.qm'**
**`'modalopen.qm'`**
The event fired immediately before a modal window is opened

**'modalclose.qm'**
**`'modalclose.qm'`**
The event fired immediately after a modal window is closed

---
Expand All @@ -204,4 +208,10 @@ $(document).ready(function() {
});
});
```
This alternative way of initializing the plugin will ensure that elements that match the selector will always open its associated modal window, regardless of whether or not they were present on page load.
This alternative way of initializing the plugin will ensure that elements that match the selector will always open its associated modal window, regardless of whether or not they were present on page load.

---

#### Using Custom Prefixes

Included in the package are Sass source files (with a variable for managing custom prefixed classes and ids) and Gulp build scripts. Be sure to use the `prefix` option in the plugin to support your custom prefix.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-quick-modal",
"version": "2.0.0",
"version": "2.1.0",
"homepage": "https://github.com/kevinberonilla/jquery-quick-modal",
"authors": [
"Kevin Beronilla <[email protected]>"
Expand Down
Loading

0 comments on commit 5f5701e

Please sign in to comment.