Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: chrome/browser/resources/flags.js

Issue 9669036: fixed about:flags by switching onclick to onchange for select element (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: adding myself to AUTHORS Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * This variable structure is here to document the structure that the template 6 * This variable structure is here to document the structure that the template
7 * expects to correctly populate the page. 7 * expects to correctly populate the page.
8 */ 8 */
9 var flagsExperimentsDataFormat = { 9 var flagsExperimentsDataFormat = {
10 'flagsExperiments': [ 10 'flagsExperiments': [
(...skipping 29 matching lines...) Expand all
40 */ 40 */
41 function renderTemplate(flagsExperimentsData) { 41 function renderTemplate(flagsExperimentsData) {
42 // This is the javascript code that processes the template: 42 // This is the javascript code that processes the template:
43 var input = new JsEvalContext(flagsExperimentsData); 43 var input = new JsEvalContext(flagsExperimentsData);
44 var output = document.getElementById('flagsExperimentTemplate'); 44 var output = document.getElementById('flagsExperimentTemplate');
45 jstProcess(input, output); 45 jstProcess(input, output);
46 46
47 // Add handlers to dynamically created HTML elements. 47 // Add handlers to dynamically created HTML elements.
48 var elements = document.getElementsByClassName('experiment-select'); 48 var elements = document.getElementsByClassName('experiment-select');
49 for (var i = 0; i < elements.length; ++i) { 49 for (var i = 0; i < elements.length; ++i) {
50 elements[i].onclick = function () { 50 elements[i].onchange = function () {
51 handleSelectChoiceExperiment(this, this.selectedIndex); 51 handleSelectChoiceExperiment(this, this.selectedIndex);
52 return false; 52 return false;
53 }; 53 };
54 } 54 }
55 55
56 elements = document.getElementsByClassName('experiment-disable-link'); 56 elements = document.getElementsByClassName('experiment-disable-link');
57 for (var i = 0; i < elements.length; ++i) { 57 for (var i = 0; i < elements.length; ++i) {
58 elements[i].onclick = function () { 58 elements[i].onclick = function () {
59 handleEnableExperiment(this, false); 59 handleEnableExperiment(this, false);
60 return false; 60 return false;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 function handleSelectChoiceExperiment(node, index) { 118 function handleSelectChoiceExperiment(node, index) {
119 // Tell the C++ FlagsDOMHandler to enable the selected choice. 119 // Tell the C++ FlagsDOMHandler to enable the selected choice.
120 chrome.send('enableFlagsExperiment', 120 chrome.send('enableFlagsExperiment',
121 [String(node.internal_name) + "@" + index, "true"]); 121 [String(node.internal_name) + "@" + index, "true"]);
122 requestFlagsExperimentsData(); 122 requestFlagsExperimentsData();
123 } 123 }
124 124
125 // Get data and have it displayed upon loading. 125 // Get data and have it displayed upon loading.
126 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); 126 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData);
127 127
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698