summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notebook
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/notebook')
-rw-r--r--app/assets/javascripts/notebook/cells/output/index.vue25
1 files changed, 13 insertions, 12 deletions
diff --git a/app/assets/javascripts/notebook/cells/output/index.vue b/app/assets/javascripts/notebook/cells/output/index.vue
index 5bde30799b0..91b2269a83a 100644
--- a/app/assets/javascripts/notebook/cells/output/index.vue
+++ b/app/assets/javascripts/notebook/cells/output/index.vue
@@ -26,30 +26,18 @@
default: () => ({}),
},
},
- data() {
- return {
- outputType: '',
- };
- },
computed: {
componentName() {
if (this.output.text) {
return 'code-cell';
} else if (this.output.data['image/png']) {
- this.outputType = 'image/png';
-
return 'image-output';
} else if (this.output.data['text/html']) {
- this.outputType = 'text/html';
-
return 'html-output';
} else if (this.output.data['image/svg+xml']) {
- this.outputType = 'image/svg+xml';
-
return 'html-output';
}
- this.outputType = 'text/plain';
return 'code-cell';
},
rawCode() {
@@ -59,6 +47,19 @@
return this.dataForType(this.outputType);
},
+ outputType() {
+ if (this.output.text) {
+ return '';
+ } else if (this.output.data['image/png']) {
+ return 'image/png';
+ } else if (this.output.data['text/html']) {
+ return 'text/html';
+ } else if (this.output.data['image/svg+xml']) {
+ return 'image/svg+xml';
+ }
+
+ return 'text/plain';
+ },
},
methods: {
dataForType(type) {