Simplify visible section checking by abusing Vue behavior, since the proper way is being buggy.
This commit is contained in:
parent
0beff189d1
commit
631d0375c3
|
@ -404,7 +404,6 @@ else if (log?.IsValid == true)
|
||||||
v-bind:showScreenId="showScreenId"
|
v-bind:showScreenId="showScreenId"
|
||||||
v-bind:message="msg"
|
v-bind:message="msg"
|
||||||
v-bind:highlight="shouldHighlight"
|
v-bind:highlight="shouldHighlight"
|
||||||
v-bind:sectionExpanded="msg.SectionName && visibleSections.includes(msg.SectionName)"
|
|
||||||
/>
|
/>
|
||||||
</log-table>
|
</log-table>
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,10 +347,6 @@ smapi.logParser = function (data, sectionUrl) {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
sectionExpanded: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
highlight: {
|
highlight: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false
|
required: false
|
||||||
|
@ -379,7 +375,7 @@ smapi.logParser = function (data, sectionUrl) {
|
||||||
const events = {};
|
const events = {};
|
||||||
let toggleMessage;
|
let toggleMessage;
|
||||||
if (msg.IsStartOfSection) {
|
if (msg.IsStartOfSection) {
|
||||||
const visible = context.props.sectionExpanded;
|
const visible = msg.SectionName && window.app && app.sectionsAllow(msg.SectionName);
|
||||||
events.click = smapi.clickLogLine;
|
events.click = smapi.clickLogLine;
|
||||||
toggleMessage = visible ?
|
toggleMessage = visible ?
|
||||||
'This section is shown. Click here to hide it.' :
|
'This section is shown. Click here to hide it.' :
|
||||||
|
@ -477,13 +473,6 @@ smapi.logParser = function (data, sectionUrl) {
|
||||||
// Maybe not strictly necessary, but the Vue template is being
|
// Maybe not strictly necessary, but the Vue template is being
|
||||||
// weird about accessing data entries on the app rather than
|
// weird about accessing data entries on the app rather than
|
||||||
// computed properties.
|
// computed properties.
|
||||||
visibleSections: function () {
|
|
||||||
const ret = [];
|
|
||||||
for (const [k, v] of Object.entries(this.showSections))
|
|
||||||
if (v !== false)
|
|
||||||
ret.push(k);
|
|
||||||
return ret;
|
|
||||||
},
|
|
||||||
hideContentPacks: function () {
|
hideContentPacks: function () {
|
||||||
return !data.showContentPacks;
|
return !data.showContentPacks;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue