-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin3.js
More file actions
45 lines (34 loc) · 1.02 KB
/
admin3.js
File metadata and controls
45 lines (34 loc) · 1.02 KB
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
var modal2 = document.getElementById('myModal2');
var log1 = document.getElementsByClassName("correct");
var span1 = document.getElementById("close3");
span1.onclick = function() {
modal2.style.display = "none";
}
var edListener = function(event){
tr=$(event.target).closest("tr").children();
console.log($(tr[0]).html());
console.log($(tr[1]).html());
$(num).val($(tr[0]).html());
$(title1).val($(tr[1]).html());
$(id_category1).val($(tr[2]).html());
$(content1).val($(tr[3]).html());
$(url_image1).val($(tr[4]).html());
}
$(".correct").bind("click", function(event){
modal2.style.display = "block";
$(eddel).val(("ed"));
edListener(event);
});
$(".sub").bind("click", function(event){
document.getElementById("fr12").submit();
});
$(".del").bind("click", function(event){
edListener(event);
$(eddel).val(("del"));
document.getElementById("fr12").submit();
});
window.onclick = function(event) {
if (event.target == modal2) {
modal2.style.display = "none";
}
}