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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2490433002: DevTools: clicking console messages with traces should check for links (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/resources/source3.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 */ 321 */
322 function expandStackTrace(expand) { 322 function expandStackTrace(expand) {
323 stackTraceElement.classList.toggle('hidden', !expand); 323 stackTraceElement.classList.toggle('hidden', !expand);
324 toggleElement.classList.toggle('expanded', expand); 324 toggleElement.classList.toggle('expanded', expand);
325 } 325 }
326 326
327 /** 327 /**
328 * @param {?Event} event 328 * @param {?Event} event
329 */ 329 */
330 function toggleStackTrace(event) { 330 function toggleStackTrace(event) {
331 if (event.target.hasSelection()) 331 var linkClicked = event.target && event.target.enclosingNodeOrSelfWithNode Name('a');
332 if (event.target.hasSelection() || linkClicked)
332 return; 333 return;
333 expandStackTrace(stackTraceElement.classList.contains('hidden')); 334 expandStackTrace(stackTraceElement.classList.contains('hidden'));
334 event.consume(); 335 event.consume();
335 } 336 }
336 337
337 clickableElement.addEventListener('click', toggleStackTrace, false); 338 clickableElement.addEventListener('click', toggleStackTrace, false);
338 if (consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace) 339 if (consoleMessage.type === WebInspector.ConsoleMessage.MessageType.Trace)
339 expandStackTrace(true); 340 expandStackTrace(true);
340 341
341 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); 342 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true);
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 * @return {!Element} 1231 * @return {!Element}
1231 */ 1232 */
1232 toMessageElement() { 1233 toMessageElement() {
1233 if (!this._element) { 1234 if (!this._element) {
1234 super.toMessageElement(); 1235 super.toMessageElement();
1235 this._element.classList.toggle('collapsed', this._collapsed); 1236 this._element.classList.toggle('collapsed', this._collapsed);
1236 } 1237 }
1237 return this._element; 1238 return this._element;
1238 } 1239 }
1239 }; 1240 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/resources/source3.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698