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

View File

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