Skip to content
This repository was archived by the owner on Mar 20, 2018. It is now read-only.

Commit 68a8de0

Browse files
committed
Bind events to document for IE < 9 compatibility (events do not bubble to window)
1 parent 8bada63 commit 68a8de0

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ https://github.com/i-like-robots/jQuery-Modal/issues
2121

2222
## Versioning
2323

24-
The current version is `0.8.0`. Releases will be numbered in following format:
24+
The current version is `0.8.1`. Releases will be numbered in following format:
2525

2626
`<major>.<minor>.<patch>`
2727

js/modal.js

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/*!
1+
/**
22
* @name jQuery Modal
33
* @author Matt Hinchliffe <https://github.com/i-like-robots/jQuery-Modal>
44
* @modified 24/04/2012
5-
* @version 0.8.0
6-
*/
7-
8-
/**
5+
* @version 0.8.1
96
* @description A simple modal overlay
107
*
118
* @example jQuery plugin setup
@@ -153,21 +150,21 @@
153150

154151
if (this.isBody)
155152
{
156-
this.context
157-
.on('resize.modal', function()
158-
{
159-
self.align();
160-
})
161-
.on('keyup.modal', function(e)
153+
this.context.on('resize.modal', function()
154+
{
155+
self.align();
156+
});
157+
158+
this.doc.on('keyup.modal', function(e)
159+
{
160+
if ( e.keyCode === 27 )
162161
{
163-
if ( e.keyCode === 27 )
164-
{
165-
self.close();
166-
}
167-
});
162+
self.close();
163+
}
164+
});
168165
}
169166

170-
this.context.on('click.modal', '[data-toggle="modal"]', function(e)
167+
this.doc.on('click.modal', '[data-toggle="modal"]', function(e)
171168
{
172169
e.preventDefault();
173170
self.close();
@@ -241,7 +238,7 @@
241238
var self = this;
242239

243240
// Unbind events
244-
this.context.off('.modal');
241+
this.doc.off('.modal');
245242

246243
// Fade out
247244
this.wrapper

js/modal.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)