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

Side by Side Diff: chrome/content/ui/firstRun.js

Issue 10860047: New toggle button on First-run page (Closed)
Patch Set: Change button to have dynamic width Created June 11, 2013, 12:05 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 UI.openFiltersDialog(); 264 UI.openFiltersDialog();
265 else 265 else
266 { 266 {
267 backgroundPage.openOptions(); 267 backgroundPage.openOptions();
268 } 268 }
269 } 269 }
270 270
271 function updateToggleButton(feature, isEnabled) 271 function updateToggleButton(feature, isEnabled)
272 { 272 {
273 var button = E("toggle-" + feature); 273 var button = E("toggle-" + feature);
274 button.className = isEnabled ? "disable" : "enable"; 274 if (isEnabled && button.classList.contains("off"))
275 button.textContent = i18n.getMessage(isEnabled ? "firstRun_action_disable" : "firstRun_action_enable"); 275 button.classList.remove("off");
276 else if (!isEnabled && !button.classList.contains("off"))
277 button.classList.add("off");
Wladimir Palant 2013/07/08 09:37:29 classList.remove() and classList.add() already do
Thomas Greiner 2013/07/08 10:30:19 Done.
276 } 278 }
277 279
278 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 280 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
279 })(); 281 })();
OLDNEW

Powered by Google App Engine
This is Rietveld