Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/ratchet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2016-03-21 12:30:08 +0300
committerXhmikosR <xhmikosr@gmail.com>2016-03-21 12:30:15 +0300
commitc662c76a369148ac8887ac1831301de15e85e90f (patch)
tree69866aef4b7f1fe7d75697db8e63b63ebb72419c /dist/js/ratchet.js
parentf2c8956237c06a3c19263c446be4135a2b16c7d3 (diff)
Run `grunt`.HEADmaster
[ci skip]
Diffstat (limited to 'dist/js/ratchet.js')
-rw-r--r--dist/js/ratchet.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/dist/js/ratchet.js b/dist/js/ratchet.js
index 97fbd92..7defe2c 100644
--- a/dist/js/ratchet.js
+++ b/dist/js/ratchet.js
@@ -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');