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

Unified Diff: Source/devtools/front_end/Placard.js

Issue 102833003: DevTools: Add a checkbox to enable async stacks in the sidebar header. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 7 years 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 | « Source/devtools/front_end/DebuggerModel.js ('k') | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/Placard.js
diff --git a/Source/devtools/front_end/Placard.js b/Source/devtools/front_end/Placard.js
index 69635e81b50feb6270a3fecf8f21a1b35225e106..cc54fd58c67c9999927cd4e1a48c581f4b918560 100644
--- a/Source/devtools/front_end/Placard.js
+++ b/Source/devtools/front_end/Placard.js
@@ -85,28 +85,10 @@ WebInspector.Placard.prototype = {
this.deselect();
},
- /**
- * @return {!WebInspector.PlacardGroup|undefined}
- */
- group: function()
- {
- return this._group;
- },
-
- /**
- * @param {!WebInspector.PlacardGroup} group
- */
- setGroup: function(group)
- {
- this._group = group;
- },
-
select: function()
{
if (this._selected)
return;
- if (this._group)
- this._group.setExpanded(true);
this._selected = true;
this.element.addStyleClass("selected");
},
@@ -128,94 +110,3 @@ WebInspector.Placard.prototype = {
{
}
}
-
-/**
- * @constructor
- * @param {string} title
- * @param {!Array.<!WebInspector.Placard>} placards
- */
-WebInspector.PlacardGroup = function(title, placards)
-{
- this.element = document.createElementWithClass("div", "placard placard-group");
- this.element.addEventListener("click", this._toggleExpanded.bind(this), false);
- this.placards = placards;
- this._expanded = false;
- this.setTitle(title);
-
- for (var i = 0; i < placards.length; ++i)
- placards[i].setGroup(this);
-}
-
-WebInspector.PlacardGroup.prototype = {
- /**
- * @return {string}
- */
- title: function()
- {
- return this._title;
- },
-
- /**
- * @param {string} title
- */
- setTitle: function(title)
- {
- this._title = title;
- this.element.textContent = title;
- },
-
- /**
- * @return {boolean}
- */
- expanded: function()
- {
- return this._expanded;
- },
-
- /**
- * @param {boolean} x
- */
- setExpanded: function(x)
- {
- if (this._expanded === x)
- return;
- if (x) {
- var parent = this.element.parentElement;
- if (!parent)
- return;
- var sibling = this.element.nextSibling;
- for (var i = 0; i < this.placards.length; ++i) {
- var placard = this.placards[i];
- placard.element.addStyleClass("grouped");
- parent.insertBefore(placard.element, sibling);
- }
- } else {
- if (this.selected())
- return;
- for (var i = 0; i < this.placards.length; ++i) {
- var placard = this.placards[i];
- placard.element.removeStyleClass("grouped");
- placard.element.remove();
- }
- }
- this._expanded = x;
- },
-
- /**
- * @return {boolean}
- */
- selected: function()
- {
- for (var i = 0; i < this.placards.length; ++i) {
- if (this.placards[i].selected)
- return true;
- }
- return false;
- },
-
- _toggleExpanded: function()
- {
- this.setExpanded(!this._expanded);
- this.element.enableStyleClass("expanded", this._expanded);
- }
-}
« no previous file with comments | « Source/devtools/front_end/DebuggerModel.js ('k') | Source/devtools/front_end/Settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698