Permalink
Browse files

Run `grunt`.

[ci skip]
  • Loading branch information...
1 parent f2c8956 commit c662c76a369148ac8887ac1831301de15e85e90f @XhmikosR XhmikosR committed Mar 21, 2016
View
@@ -76,14 +76,6 @@
!(function () {
'use strict';
- var eventModalOpen = new CustomEvent('modalOpen', {
- bubbles: true,
- cancelable: true
- });
- var eventModalClose = new CustomEvent('modalClose', {
- bubbles: true,
- cancelable: true
- });
var findModals = function (target) {
var i;
var modals = document.querySelectorAll('a');
@@ -107,9 +99,18 @@
window.addEventListener('touchend', function (event) {
var modal = getModal(event);
if (modal && modal.classList.contains('modal')) {
- var eventToDispatch = eventModalOpen;
+ var eventToDispatch = null;
if (modal.classList.contains('active')) {
- eventToDispatch = eventModalClose;
+ eventToDispatch = new CustomEvent('modalClose', {
+ bubbles: true,
+ cancelable: true
+ });
+ }
+ else {
+ eventToDispatch = new CustomEvent('modalOpen', {
+ bubbles: true,
+ cancelable: true
+ });
}
modal.dispatchEvent(eventToDispatch);
modal.classList.toggle('active');
Oops, something went wrong.
Oops, something went wrong.
@@ -76,14 +76,6 @@
!(function () {
'use strict';
- var eventModalOpen = new CustomEvent('modalOpen', {
- bubbles: true,
- cancelable: true
- });
- var eventModalClose = new CustomEvent('modalClose', {
- bubbles: true,
- cancelable: true
- });
var findModals = function (target) {
var i;
var modals = document.querySelectorAll('a');
@@ -107,9 +99,18 @@
window.addEventListener('touchend', function (event) {
var modal = getModal(event);
if (modal && modal.classList.contains('modal')) {
- var eventToDispatch = eventModalOpen;
+ var eventToDispatch = null;
if (modal.classList.contains('active')) {
- eventToDispatch = eventModalClose;
+ eventToDispatch = new CustomEvent('modalClose', {
+ bubbles: true,
+ cancelable: true
+ });
+ }
+ else {
+ eventToDispatch = new CustomEvent('modalOpen', {
+ bubbles: true,
+ cancelable: true
+ });
}
modal.dispatchEvent(eventToDispatch);
modal.classList.toggle('active');
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit c662c76

Please sign in to comment.