Skip to content

Commit

Permalink
Merge pull request #139 from drublic/bugfix-enable-IE8
Browse files Browse the repository at this point in the history
The user can now load/mock Bean during the runtime
  • Loading branch information
drublic committed Jun 4, 2014
2 parents 85b5097 + 69ab4bc commit 7e10b8c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## HEAD
* The user can now load/mock Bean during the runtime
* Add polyfill for event.preventDefault to work with IE8
* Add plugin to strech a modal to 80% of the screen height
* Prevent scrolling of body on small screens
Expand Down
15 changes: 9 additions & 6 deletions modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

'use strict';

// We use bean if the browser doesn't support CustomEvents
if (!global.CustomEvent && !global.bean) {
throw new Error('This browser doesn\'t support CustomEvent - please include bean: https://github.com/fat/bean');
}

/*
* Storage for functions and attributes
*/
Expand Down Expand Up @@ -374,7 +369,15 @@

// Register as an AMD module
} else if (typeof define === 'function' && define.amd) {
define('CSSModal', [], function () { return modal; });
define('CSSModal', [], function () {

// We use bean if the browser doesn't support CustomEvents
if (!global.CustomEvent && !global.bean) {
throw new Error('This browser doesn\'t support CustomEvent - please include bean: https://github.com/fat/bean');
}

return modal;
});

// Export CSSModal into global space
} else if (typeof global === 'object' && typeof global.document === 'object') {
Expand Down
8 changes: 6 additions & 2 deletions plugins/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@
* navigation
* @return {void}
*/
var _initNavigation = function (event) {
_activeElement = event.detail.modal;
var _initNavigation = function (event, eventData) {
if (arguments.length === 2) {
_activeElement = eventData.detail.modal;
} else {
_activeElement = event.detail.modal;
}

if (_activeElement.querySelectorAll('.modal-detail').length === 0) {
return;
Expand Down

0 comments on commit 7e10b8c

Please sign in to comment.