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

Unified Diff: content/browser/resources/media/new/collapse.js

Issue 18889006: Removed old media-internals page and rewrote it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved all 'new' media internals files into its own folder for a smooth transition. Created 7 years, 5 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 | « no previous file | content/browser/resources/media/new/gen_logs.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/media/new/collapse.js
diff --git a/content/browser/resources/media/new/collapse.js b/content/browser/resources/media/new/collapse.js
new file mode 100644
index 0000000000000000000000000000000000000000..c24aa80dbb404fb5cd540610d43a9bfe349bf929
--- /dev/null
+++ b/content/browser/resources/media/new/collapse.js
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+/**
+ * @fileoverview Sets up the event handlers for the collapsing containers
+ */
+
+(function () {
+ "use strict";
+ var allCollapseDivs = document.querySelectorAll('.collapse');
+ (Array.prototype.slice.call(allCollapseDivs)).forEach(function (elem) {
+ // find the header for the div, because we only want to trigger on that
+ var header = elem.querySelector("h2");
+ header.onclick = function () {
+ var wasOpen = elem.className.indexOf("open") !== -1;
+
+ if (wasOpen) {
+ elem.className = "collapse closed";
+ } else {
+ elem.className = "collapse open";
+ }
+ };
+ });
+
+}());
« no previous file with comments | « no previous file | content/browser/resources/media/new/gen_logs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698