Merge pull request #2707 from nasa/alternate-control-bar-fixes

[Telemetry Tables] - Alternate control bar fixes
This commit is contained in:
David Tsay 2020-03-04 11:54:38 -08:00 committed by GitHub
commit 47c388450f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -51,6 +51,14 @@ define([
view(domainObject, objectPath) {
let table = new TelemetryTable(domainObject, openmct);
let component;
let markingProp = {
enable: true,
useAlternateControlBar: false,
rowName: '',
rowNamePlural: ''
};
return {
show: function (element, editMode) {
component = new Vue({
@ -60,15 +68,16 @@ define([
},
data() {
return {
isEditing: editMode
}
isEditing: editMode,
markingProp
};
},
provide: {
openmct,
table,
objectPath
},
template: '<table-component :isEditing="isEditing" :marking="{enable: true}"/>'
template: '<table-component :isEditing="isEditing" :marking="markingProp"/>'
});
},
onEditModeChange(editMode) {

View File

@ -71,7 +71,7 @@
<!-- main controlbar end -->
<!-- alternate controlbar start -->
<div v-if="marking.useAlternateControlBar && markedRows.length"
<div v-if="marking.useAlternateControlBar"
class="c-table-control-bar c-control-bar"
>
<div class="c-control-bar__label">
@ -86,6 +86,7 @@
/>
<button
:class="{'hide-nice': !markedRows.length}"
class="c-button icon-x labeled"
title="Deselect All"
@click="unmarkAllRows()"
@ -713,6 +714,10 @@ export default {
row.marked = false;
this.markedRows.splice(positionInMarkedArray, 1);
if (this.isShowingMarkedRowsOnly) {
this.visibleRows.splice(rowIndex, 1);
}
} else if (this.markedRows.length === 1) {
this.unmarkAllRows();
}