projects
/
plack-app-gruntmaster.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade to ECMAScript 6
[plack-app-gruntmaster.git]
/
js
/
10-modal.js
diff --git
a/js/10-modal.js
b/js/10-modal.js
index 980bab79a987ae6001413765e665d6fb7390d69c..1c290ef1252ce3d236f7c4208efd3fd45c4f3704 100644
(file)
--- a/
js/10-modal.js
+++ b/
js/10-modal.js
@@
-1,4
+1,4
@@
-
var
modal, hiding;
+
let
modal, hiding;
function show_modal () {
modal.classList.remove('hidden');
function show_modal () {
modal.classList.remove('hidden');
@@
-13,19
+13,17
@@
function hide_modal () {
$(function() {
modal = $('.modal')[0];
$(function() {
modal = $('.modal')[0];
- $(modal).on('transitionend',
function ()
{
+ $(modal).on('transitionend',
el =>
{
if(!document.body.classList.contains('modal-open'))
modal.classList.add('hidden');
});
if(!document.body.classList.contains('modal-open'))
modal.classList.add('hidden');
});
- $('.backdrop,.modal').each(function(el){
- document.body.appendChild(el);
- });
- $('#solution').on('click', function (e){
+ $('.backdrop,.modal').each(el => document.body.appendChild(el) );
+ $('#solution').on('click', e => {
show_modal();
e.preventDefault();
});
$('.backdrop').on('click', hide_modal);
show_modal();
e.preventDefault();
});
$('.backdrop').on('click', hide_modal);
- window.onkeyup =
function (event)
{
+ window.onkeyup =
event =>
{
if (event.keyCode === 27)
hide_modal();
}
if (event.keyCode === 27)
hide_modal();
}
This page took
0.010065 seconds
and
4
git commands to generate.