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

Side by Side Diff: Source/devtools/front_end/ui/SidebarPane.js

Issue 340513003: DevTools: Add JSDoc for static methods, fix JSDoc types and induced errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased patch Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 this.element.appendChild(this._pane.titleElement); 119 this.element.appendChild(this._pane.titleElement);
120 120
121 this._pane.setExpandCallback(this._expand.bind(this)); 121 this._pane.setExpandCallback(this._expand.bind(this));
122 } 122 }
123 123
124 WebInspector.SidebarPaneTitle.prototype = { 124 WebInspector.SidebarPaneTitle.prototype = {
125 125
126 _expand: function() 126 _expand: function()
127 { 127 {
128 this.element.classList.add("expanded"); 128 this.element.classList.add("expanded");
129 this._pane.show(this.element.parentNode, this.element.nextSibling); 129 this._pane.show(this.element.parentElement, /** @type {?Element} */ (thi s.element.nextSibling));
130 }, 130 },
131 131
132 _collapse: function() 132 _collapse: function()
133 { 133 {
134 this.element.classList.remove("expanded"); 134 this.element.classList.remove("expanded");
135 if (this._pane.element.parentNode == this.element.parentNode) 135 if (this._pane.element.parentNode == this.element.parentNode)
136 this._pane.detach(); 136 this._pane.detach();
137 }, 137 },
138 138
139 _toggleExpanded: function() 139 _toggleExpanded: function()
140 { 140 {
141 if (this.element.classList.contains("expanded")) 141 if (this.element.classList.contains("expanded"))
142 this._collapse(); 142 this._collapse();
143 else 143 else
144 this._pane.expand(); 144 this._pane.expand();
145 }, 145 },
146 146
147 /** 147 /**
148 * @param {!Event} event 148 * @param {?Event} event
149 */ 149 */
150 _onTitleKeyDown: function(event) 150 _onTitleKeyDown: function(event)
151 { 151 {
152 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut .Keys.Space.code) 152 if (isEnterKey(event) || event.keyCode === WebInspector.KeyboardShortcut .Keys.Space.code)
153 this._toggleExpanded(); 153 this._toggleExpanded();
154 } 154 }
155 } 155 }
156 156
157 /** 157 /**
158 * @constructor 158 * @constructor
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 { 198 {
199 var title = pane.title(); 199 var title = pane.title();
200 this.appendTab(title, title, pane); 200 this.appendTab(title, title, pane);
201 pane.element.appendChild(pane.titleElement); 201 pane.element.appendChild(pane.titleElement);
202 pane.setExpandCallback(this.selectTab.bind(this, title)); 202 pane.setExpandCallback(this.selectTab.bind(this, title));
203 203
204 }, 204 },
205 205
206 __proto__: WebInspector.TabbedPane.prototype 206 __proto__: WebInspector.TabbedPane.prototype
207 } 207 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/SettingsUI.js ('k') | Source/devtools/front_end/ui/StatusBarButton.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698