mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
[coverage] Disable save button if there is nothing to save
Fixed: chromium:1064206 Change-Id: I4d0ffb00077fab94bf6485d4baba6a46b101f81a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119689 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
d5a3755f19
commit
0e15e8064f
@@ -73,11 +73,12 @@ export class CoverageView extends UI.Widget.VBox {
|
||||
toolbar.appendToolbarItem(this._clearButton);
|
||||
|
||||
toolbar.appendSeparator();
|
||||
const saveButton = new UI.Toolbar.ToolbarButton(Common.UIString.UIString('Export...'), 'largeicon-download');
|
||||
saveButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, event => {
|
||||
this._saveButton = new UI.Toolbar.ToolbarButton(Common.UIString.UIString('Export...'), 'largeicon-download');
|
||||
this._saveButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, event => {
|
||||
this._exportReport();
|
||||
});
|
||||
toolbar.appendToolbarItem(saveButton);
|
||||
toolbar.appendToolbarItem(this._saveButton);
|
||||
this._saveButton.setEnabled(false);
|
||||
|
||||
/** @type {?RegExp} */
|
||||
this._textFilterRegExp = null;
|
||||
@@ -171,6 +172,7 @@ export class CoverageView extends UI.Widget.VBox {
|
||||
this._statusMessageElement.textContent = '';
|
||||
this._filterInput.setEnabled(false);
|
||||
this._filterByTypeComboBox.setEnabled(false);
|
||||
this._saveButton.setEnabled(false);
|
||||
}
|
||||
|
||||
_toggleRecording() {
|
||||
@@ -328,6 +330,7 @@ export class CoverageView extends UI.Widget.VBox {
|
||||
_updateViews(updatedEntries) {
|
||||
this._updateStats();
|
||||
this._listView.update(this._model.entries());
|
||||
this._saveButton.setEnabled(this._model.entries().length > 0);
|
||||
this._decorationManager.update(updatedEntries);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user