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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/content/ui/firstRun.js
===================================================================
--- a/chrome/content/ui/firstRun.js
+++ b/chrome/content/ui/firstRun.js
@@ -271,8 +271,10 @@
function updateToggleButton(feature, isEnabled)
{
var button = E("toggle-" + feature);
- button.className = isEnabled ? "disable" : "enable";
- button.textContent = i18n.getMessage(isEnabled ? "firstRun_action_disable" : "firstRun_action_enable");
+ if (isEnabled && button.classList.contains("off"))
+ button.classList.remove("off");
+ else if (!isEnabled && !button.classList.contains("off"))
+ 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.
}
document.addEventListener("DOMContentLoaded", onDOMLoaded, false);

Powered by Google App Engine
This is Rietveld