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

Side by Side Diff: chrome/browser/resources/welcome/win10/toggle-section.js

Issue 2401853005: Adding client code for new Windows 10 First Run Experience (Closed)
Patch Set: Comments #1 Created 4 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 cr.define('togglesection', function() {
6 'use strict';
7
8 function toggleSections(sections) {
9 sections.forEach(function(section) {
10 section.classList.toggle('section--expanded');
11 });
12 }
13
14 function initialize() {
15 var sections = document.querySelectorAll('.section');
16 sections.forEach(function(section) {
17 var sectionHeading = section.querySelector('.section-heading');
18 sectionHeading.addEventListener('click', function() {
19 toggleSections(sections);
20 });
21 });
22 }
23
24 return {
25 initialize: initialize
26 };
27 });
28
29 document.addEventListener('DOMContentLoaded', togglesection.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698