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

Side by Side Diff: components/sync_driver/resources/events.js

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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 (c) 2011 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('chrome.sync.events_tab', function() {
6 'use strict';
7
8 function toggleDisplay(event) {
9 var originatingButton = event.target;
10 if (originatingButton.className != 'toggle-button') {
11 return;
12 }
13 var detailsNode = originatingButton.parentNode.getElementsByClassName(
14 'details')[0];
15 var detailsColumn = detailsNode.parentNode;
16 var detailsRow = detailsColumn.parentNode;
17
18 if (!detailsRow.classList.contains('expanded')) {
19 detailsRow.classList.toggle('expanded');
20 detailsColumn.setAttribute('colspan', 4);
21 detailsNode.removeAttribute('hidden');
22 } else {
23 detailsNode.setAttribute('hidden', '');
24 detailsColumn.removeAttribute('colspan');
25 detailsRow.classList.toggle('expanded');
26 }
27 };
28
29 function displaySyncEvents() {
30 var entries = chrome.sync.log.entries;
31 var eventTemplateContext = {
32 eventList: entries,
33 };
34 var context = new JsEvalContext(eventTemplateContext);
35 jstProcess(context, $('sync-events'));
36 };
37
38 function onLoad() {
39 $('sync-events').addEventListener('click', toggleDisplay);
40 chrome.sync.log.addEventListener('append', function(event) {
41 displaySyncEvents();
42 });
43 }
44
45 return {
46 onLoad: onLoad
47 };
48 });
49
50 document.addEventListener(
51 'DOMContentLoaded', chrome.sync.events_tab.onLoad, false);
OLDNEW
« no previous file with comments | « components/sync_driver/resources/events.html ('k') | components/sync_driver/resources/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698