Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: popup.js

Issue 29340749: Issue 3816 - Add hidden toggle for the new options page (Closed)
Patch Set: Created April 22, 2016, 9:32 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « metadata.common ('k') | safari/ext/background.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 document.body.classList.add("clickhide-active"); 63 document.body.classList.add("clickhide-active");
64 }); 64 });
65 } 65 }
66 }); 66 });
67 67
68 document.getElementById("enabled").addEventListener("click", toggleEnabled, fa lse); 68 document.getElementById("enabled").addEventListener("click", toggleEnabled, fa lse);
69 document.getElementById("clickhide").addEventListener("click", activateClickHi de, false); 69 document.getElementById("clickhide").addEventListener("click", activateClickHi de, false);
70 document.getElementById("clickhide-cancel").addEventListener("click", cancelCl ickHide, false); 70 document.getElementById("clickhide-cancel").addEventListener("click", cancelCl ickHide, false);
71 document.getElementById("options").addEventListener("click", function() 71 document.getElementById("options").addEventListener("click", function()
72 { 72 {
73 ext.showOptions(); 73 ext.showOptions(Prefs["new_options_page"]);
74 }, false); 74 }, false);
75 75
76 // Set up collapsing of menu items 76 // Set up collapsing of menu items
77 var collapsers = document.getElementsByClassName("collapse"); 77 var collapsers = document.getElementsByClassName("collapse");
78 for (var i = 0; i < collapsers.length; i++) 78 for (var i = 0; i < collapsers.length; i++)
79 { 79 {
80 var collapser = collapsers[i]; 80 var collapser = collapsers[i];
81 collapser.addEventListener("click", toggleCollapse, false); 81 collapser.addEventListener("click", toggleCollapse, false);
82 if (!Prefs[collapser.dataset.option]) 82 if (!Prefs[collapser.dataset.option])
83 document.getElementById(collapser.dataset.collapsable).classList.add("coll apsed"); 83 document.getElementById(collapser.dataset.collapsable).classList.add("coll apsed");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 function toggleCollapse(event) 136 function toggleCollapse(event)
137 { 137 {
138 var collapser = event.currentTarget; 138 var collapser = event.currentTarget;
139 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option]; 139 Prefs[collapser.dataset.option] = !Prefs[collapser.dataset.option];
140 collapser.parentNode.classList.toggle("collapsed"); 140 collapser.parentNode.classList.toggle("collapsed");
141 } 141 }
142 142
143 document.addEventListener("DOMContentLoaded", onLoad, false); 143 document.addEventListener("DOMContentLoaded", onLoad, false);
OLDNEW
« no previous file with comments | « metadata.common ('k') | safari/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld