Skip to content

Commit 3d63b6b

Browse files
committed
Remember toggle state of components in inspector
1 parent d45fc64 commit 3d63b6b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

etc/js/components/widgets/inspector/entity-inspector-component.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default { name: "entity-inspector-component" }
111111
</script>
112112

113113
<script setup>
114-
import { defineEmits, defineProps, defineModel, ref, computed } from 'vue';
114+
import { defineEmits, defineProps, defineModel, ref, computed, onMounted } from 'vue';
115115
116116
const props = defineProps({
117117
conn: {type: Object, required: true},
@@ -187,6 +187,7 @@ const canExpand = computed(() => {
187187
function toggle() {
188188
if (canExpand.value) {
189189
expand.value = !expand.value;
190+
localStorage.setItem(`${props.fullName}.expand`, String(expand.value));
190191
}
191192
}
192193
@@ -238,6 +239,10 @@ function onEntity(evt) {
238239
emit("selectEntity", evt);
239240
}
240241
242+
onMounted(() => {
243+
expand.value = localStorage.getItem(`${props.fullName}.expand`) === "true";
244+
});
245+
241246
</script>
242247

243248
<style scoped>

0 commit comments

Comments
 (0)