diff --git a/lib/json-viewer.vue b/lib/json-viewer.vue
index 7acb5c7..2c22f4a 100644
--- a/lib/json-viewer.vue
+++ b/lib/json-viewer.vue
@@ -13,7 +13,7 @@
@@ -88,8 +88,10 @@ export default {
}
},
mounted: function () {
- this.onResized()
- this.$el.addEventListener("resized", this.onResized, true)
+ if (this.boxed && this.$refs.jsonBox) {
+ this.onResized()
+ this.$refs.jsonBox.$el.addEventListener("resized", this.onResized, true)
+ }
},
methods: {
onResized () {
@@ -212,12 +214,15 @@ export default {
}
.jv-code {
- max-height: 300px;
overflow: hidden;
padding: 20px;
+ &.boxed {
+ max-height: 300px;
+ }
+
&.open {
- max-height: initial;
+ max-height: initial !important;
overflow: visible;
overflow-x: auto;
padding-bottom: 45px;