-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
32 lines (29 loc) · 1.04 KB
/
popup.js
File metadata and controls
32 lines (29 loc) · 1.04 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
chrome.storage.sync.get(["sorted_status"], (value) => {
if(value.sorted_status === undefined) {
chrome.storage.sync.set({"sorted_status": "enabled"}, () => {
console.log("Sorted chrome extension is enabled!");
});
} else {
if(value.sorted_status === "enabled") {
$("#enabled").css("background-color", "#7935b1");
$("#disabled").css("background-color", "#5CDB95");
} else {
$("#disabled").css("background-color", "#7935b1");
$("#enabled").css("background-color", "#5CDB95");
}
}
});
$("#enabled").click(e => {
$("#enabled").css("background-color", "#7935b1");
$("#disabled").css("background-color", "#5CDB95");
chrome.storage.sync.set({"sorted_status": "enabled"}, () => {
console.log("Sorted chrome extension is enabled!");
});
});
$("#disabled").click(e => {
$("#disabled").css("background-color", "#7935b1");
$("#enabled").css("background-color", "#5CDB95");
chrome.storage.sync.set({"sorted_status": "disabled"}, () => {
console.log("Sorted chrome extension is disabled!");
});
});