Commit 4befd210 authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

MD Extensions: clear code section when switching between different error consoles.

Bug: 793397
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id9ae040cfc149fe3483156ab80dfaeaa5a2566de
Reviewed-on: https://chromium-review.googlesource.com/817371Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Scott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523528}
parent 79d229fc
...@@ -62,7 +62,10 @@ cr.define('extensions', function() { ...@@ -62,7 +62,10 @@ cr.define('extensions', function() {
* Index into |entries_|. * Index into |entries_|.
* @private * @private
*/ */
selectedEntry_: Number, selectedEntry_: {
type: Number,
observer: 'onSelectedErrorChanged_',
},
/** @private {?chrome.developerPrivate.StackFrame}*/ /** @private {?chrome.developerPrivate.StackFrame}*/
selectedStackFrame_: { selectedStackFrame_: {
...@@ -75,7 +78,6 @@ cr.define('extensions', function() { ...@@ -75,7 +78,6 @@ cr.define('extensions', function() {
observers: [ observers: [
'observeDataChanges_(data.*)', 'observeDataChanges_(data.*)',
'onSelectedErrorChanged_(selectedEntry_)',
], ],
/** @override */ /** @override */
...@@ -96,7 +98,9 @@ cr.define('extensions', function() { ...@@ -96,7 +98,9 @@ cr.define('extensions', function() {
observeDataChanges_: function() { observeDataChanges_: function() {
const errors = this.data.manifestErrors.concat(this.data.runtimeErrors); const errors = this.data.manifestErrors.concat(this.data.runtimeErrors);
this.entries_ = errors; this.entries_ = errors;
this.selectedEntry_ = this.entries_.length ? 0 : -1; this.selectedEntry_ = -1; // This also help reset code-section content.
if (this.entries_.length)
this.selectedEntry_ = 0;
}, },
/** @private */ /** @private */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment