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

Side by Side Diff: Source/devtools/front_end/sources/RevisionHistoryView.js

Issue 944343002: DevTools: migrate treeoutline from hasChildren to is/setExpandable(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (!allowRevert) 217 if (!allowRevert)
218 this._revertElement.classList.add("hidden"); 218 this._revertElement.classList.add("hidden");
219 } 219 }
220 220
221 WebInspector.RevisionHistoryTreeElement.prototype = { 221 WebInspector.RevisionHistoryTreeElement.prototype = {
222 onattach: function() 222 onattach: function()
223 { 223 {
224 this.listItemElement.classList.add("revision-history-revision"); 224 this.listItemElement.classList.add("revision-history-revision");
225 }, 225 },
226 226
227 onexpand: function() 227 onpopulate: function()
228 { 228 {
229 this.listItemElement.appendChild(this._revertElement); 229 this.listItemElement.appendChild(this._revertElement);
230 230
231 if (this._wasExpandedOnce)
232 return;
233 this._wasExpandedOnce = true;
234
235 this.childrenListElement.classList.add("source-code"); 231 this.childrenListElement.classList.add("source-code");
236 if (this._baseRevision) 232 if (this._baseRevision)
237 this._baseRevision.requestContent(step1.bind(this)); 233 this._baseRevision.requestContent(step1.bind(this));
238 else 234 else
239 this._revision.uiSourceCode.requestOriginalContent(step1.bind(this)) ; 235 this._revision.uiSourceCode.requestOriginalContent(step1.bind(this)) ;
240 236
241 /** 237 /**
242 * @param {?string} baseContent 238 * @param {?string} baseContent
243 * @this {WebInspector.RevisionHistoryTreeElement} 239 * @this {WebInspector.RevisionHistoryTreeElement}
244 */ 240 */
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 contentSpan.classList.add("revision-history-line-" + changeType); 325 contentSpan.classList.add("revision-history-line-" + changeType);
330 }, 326 },
331 327
332 allowRevert: function() 328 allowRevert: function()
333 { 329 {
334 this._revertElement.classList.remove("hidden"); 330 this._revertElement.classList.remove("hidden");
335 }, 331 },
336 332
337 __proto__: TreeElement.prototype 333 __proto__: TreeElement.prototype
338 } 334 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698