-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
46 lines (34 loc) · 1.14 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
35
36
37
38
39
40
41
42
43
44
45
46
//---------------------------------------------
// DOCUMENT READY
//---------------------------------------------
$(document).ready(function() {
//---------------------------------------------
// Like
//---------------------------------------------
$(".js-like").on("click", function(event) {
event.preventDefault();
$(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");
});
//---------------------------------------------
// 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) {
event.preventDefault();
$(".js-modal").removeClass("is-visible");
$(".js-modal-overlay").removeClass("is-visible");
});
});