| OLD | NEW |
| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 */ | 323 */ |
| 324 function expandStackTrace(expand) { | 324 function expandStackTrace(expand) { |
| 325 stackTraceElement.classList.toggle('hidden', !expand); | 325 stackTraceElement.classList.toggle('hidden', !expand); |
| 326 toggleElement.classList.toggle('expanded', expand); | 326 toggleElement.classList.toggle('expanded', expand); |
| 327 } | 327 } |
| 328 | 328 |
| 329 /** | 329 /** |
| 330 * @param {?Event} event | 330 * @param {?Event} event |
| 331 */ | 331 */ |
| 332 function toggleStackTrace(event) { | 332 function toggleStackTrace(event) { |
| 333 var linkClicked = event.target && event.target.enclosingNodeOrSelfWithNode
Name('a'); | 333 if (event.target.hasSelection()) |
| 334 if (event.target.hasSelection() || linkClicked) | |
| 335 return; | 334 return; |
| 336 expandStackTrace(stackTraceElement.classList.contains('hidden')); | 335 expandStackTrace(stackTraceElement.classList.contains('hidden')); |
| 337 event.consume(); | 336 event.consume(); |
| 338 } | 337 } |
| 339 | 338 |
| 340 clickableElement.addEventListener('click', toggleStackTrace, false); | 339 clickableElement.addEventListener('click', toggleStackTrace, false); |
| 341 if (consoleMessage.type === SDK.ConsoleMessage.MessageType.Trace) | 340 if (consoleMessage.type === SDK.ConsoleMessage.MessageType.Trace) |
| 342 expandStackTrace(true); | 341 expandStackTrace(true); |
| 343 | 342 |
| 344 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); | 343 toggleElement._expandStackTraceForTest = expandStackTrace.bind(null, true); |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 * @return {!Element} | 1232 * @return {!Element} |
| 1234 */ | 1233 */ |
| 1235 toMessageElement() { | 1234 toMessageElement() { |
| 1236 if (!this._element) { | 1235 if (!this._element) { |
| 1237 super.toMessageElement(); | 1236 super.toMessageElement(); |
| 1238 this._element.classList.toggle('collapsed', this._collapsed); | 1237 this._element.classList.toggle('collapsed', this._collapsed); |
| 1239 } | 1238 } |
| 1240 return this._element; | 1239 return this._element; |
| 1241 } | 1240 } |
| 1242 }; | 1241 }; |
| OLD | NEW |