-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmain.js
More file actions
46 lines (36 loc) · 1.26 KB
/
main.js
File metadata and controls
46 lines (36 loc) · 1.26 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
46
let sidebar = document.querySelector(".sidebar");
let closeBtn = document.querySelector("#btn");
let searchBtn = document.querySelector(".bx-search");
closeBtn.addEventListener("click", ()=>{
sidebar.classList.toggle("open");
menuBtnChange();//calling the function(optional)
});
searchBtn.addEventListener("click", ()=>{ // Sidebar open when you click on the search iocn
sidebar.classList.toggle("open");
menuBtnChange(); //calling the function(optional)
});
// following are the code to change sidebar button(optional)
function menuBtnChange() {
if(sidebar.classList.contains("open")){
closeBtn.classList.replace("bx-menu", "bx-menu-alt-right");//replacing the iocns class
}else {
closeBtn.classList.replace("bx-menu-alt-right","bx-menu");//replacing the iocns class
}
}
var storage = firebase.storage();
var storageRef = storage.ref()
var i=0;
var ids=['0','1','2','3','4','5','6','7','8']
storageRef.child('Assignments/').listAll().then(function(result){
result.items.forEach(function(imageRef){
i++;
displayImage(i,imageRef);
});
});
function displayImage(row,images){
images.getDownloadURL().then(function(url){
var y=row.toString();
document.getElementById(ids[row]).src=url;
//document.getElementById('5').src='images/git.png';
});
}