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

Unified Diff: chrome/browser/resources/sync_internals/events.js

Issue 454573002: [Sync] Make about:sync events page more selection friendly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/sync_internals/events.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/sync_internals/events.js
diff --git a/chrome/browser/resources/sync_internals/events.js b/chrome/browser/resources/sync_internals/events.js
index 25b9ba48c73138d1b9e94d888756691605b75812..b5c406fc92c7d12f89fd1495756094bd193edf55 100644
--- a/chrome/browser/resources/sync_internals/events.js
+++ b/chrome/browser/resources/sync_internals/events.js
@@ -6,15 +6,33 @@
'use strict';
var toggleDisplay = function(event) {
var originatingButton = event.target;
+ if (originatingButton.className != 'toggleButton') {
+ return;
+ }
var detailsNode = originatingButton.parentNode.getElementsByClassName(
'details')[0];
+ var detailsColumn = detailsNode.parentNode;
+ var detailsRow = detailsColumn.parentNode;
if (detailsNode.getAttribute('hidden') != null) {
rlarocque 2014/08/07 22:49:12 hasAttribute()?
Nicolas Zea 2014/08/21 22:29:57 Done.
+ for (var node in detailsRow.childNodes) {
rlarocque 2014/08/07 22:49:12 Rather than iterate and change the DOM structure l
Nicolas Zea 2014/08/21 22:29:57 Done.
+ if (detailsRow.childNodes[node].nodeType == 1) {
rlarocque 2014/08/07 22:49:12 == Node.ELEMENT_NODE? Better yet, why not just it
Nicolas Zea 2014/08/21 22:29:57 I'd still have to check the nodeType though right?
+ detailsRow.childNodes[node].setAttribute('hidden', 'hidden');
rlarocque 2014/08/07 22:49:12 set value to ''? A hidden=hidden attribute seems
Nicolas Zea 2014/08/21 22:29:57 Done.
+ }
+ }
+ detailsColumn.removeAttribute('hidden');
+ detailsColumn.setAttribute('colspan', 4);
detailsNode.removeAttribute('hidden');
} else {
detailsNode.setAttribute('hidden', 'hidden');
+ detailsColumn.removeAttribute('colspan');
+ for (var node in detailsRow.childNodes) {
+ if (detailsRow.childNodes[node].nodeType == 1) {
+ detailsRow.childNodes[node].removeAttribute('hidden');
+ }
+ }
}
-}
+};
var syncEvents = $('sync-events');
@@ -25,7 +43,7 @@ var displaySyncEvents = function() {
};
var context = new JsEvalContext(eventTemplateContext);
jstProcess(context, syncEvents);
-}
+};
syncEvents.addEventListener('click', toggleDisplay);
chrome.sync.log.addEventListener('append', function(event) {
« no previous file with comments | « chrome/browser/resources/sync_internals/events.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698