-
Notifications
You must be signed in to change notification settings - Fork 1
/
scripts.js
33 lines (26 loc) · 1.16 KB
/
scripts.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
$(document).ready(function () {
$(document).on('click', '#pin-button', function () {
$(this).parent().parent().addClass("pinned");
}
);
$(document).on('click', '#remove', function () {
$(this).parent().parent().remove();
}
);
$(document).on('click', '.iframe-launcher', function () {
var yes = $(this);
$(`<iframe src='${$(yes).parent().siblings("p").text()}' frameborder="0" allowfullscreen ></iframe><button class='remove-iframe'>Remove</button>`).insertAfter($(this).parent().parent()).prev().css({ "width": "100%", "height": "50vh" });
$(this).parent().parent().remove();
}
);
$(document).on('click', '.remove-iframe', function () {
$(this).prev().remove();
$(this).remove();
});
$(document).on('click', '.iframe-launcher', function () {
var yes = $(this);
$(`<iframe src='${$(yes).parent().siblings("p").text()}' frameborder="0" allowfullscreen ></iframe><button class='remove-iframe'>Remove</button>`).insertAfter($(this).parent().parent()).prev().css({ "width": "100%", "height": "50vh" });
$(this).parent().parent().remove();
}
);
});