-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (31 loc) · 1.09 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//-----------------------------------------------
// Document Ready
//------------------------------------------------
$(document).ready(function(){
$('.js-like').on('click', function(event){
event.preventDefault();
// refer the currently clicked element and changed its text to Liked!
$(this).text('Liked!')
.closest('.news-item')
.addClass('is-liked');
});
//-----------------------------------------------
// Add link
//------------------------------------------------
$('.js-add-link').on('click', function(event){
event.preventDefault();
$('.js-form').toggleClass('is-visible');
});
//-----------------------------------------------
// show modal
//------------------------------------------------
$('.js-show-modal').on('click', function(event){
event.preventDefault();
$('.js-modal').addClass('is-visible');
$('.js-modal-overlay').addClass('is-visible');
});
$('.js-modal-overlay').on('click', function(event){
$('.js-modal').removeClass('is-visible');
$('.js-modal-overlay').removeClass('is-visible');
});
});