Skip to content

Commit 89bc789

Browse files
committed
Align editor layout
1 parent fae2661 commit 89bc789

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

client/src/components/Markdown/Editor/CellCode.vue

+17-8
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,26 @@ async function buildEditor() {
4444
theme: themePath,
4545
useWorker: false,
4646
value: props.modelValue,
47+
wrap: true,
4748
});
4849
49-
/*/ Update modelValue when editor content changes
50-
// Set the mode (language) if needed
51-
editor.session.setMode("ace/mode/javascript");
52-
aceEditor.session.on('change', () => {
53-
const newValue = aceEditor.getValue();
54-
emit('update:modelValue', newValue);
55-
});*/
56-
5750
aceEditor.on("focus", () => {
5851
aceEditor.setOption("highlightActiveLine", true);
5952
aceEditor.setOption("highlightGutterLine", true);
53+
editor.value.classList.add("cell-code-focus");
6054
});
6155
aceEditor.on("blur", () => {
6256
aceEditor.setOption("highlightActiveLine", false);
6357
aceEditor.setOption("highlightGutterLine", false);
58+
editor.value.classList.remove("cell-code-focus");
6459
});
60+
61+
/*/ Update modelValue when editor content changes
62+
// Set the mode (language) if needed
63+
aceEditor.session.on('change', () => {
64+
const newValue = aceEditor.getValue();
65+
emit('update:modelValue', newValue);
66+
});*/
6567
}
6668
6769
// Initialize the Ace editor
@@ -79,3 +81,10 @@ onMounted(() => {
7981
}
8082
);*/
8183
</script>
84+
85+
<style lang="scss">
86+
@import "theme/blue.scss";
87+
.cell-code-focus {
88+
background-color: $gray-100;
89+
}
90+
</style>

client/src/components/Markdown/Editor/CellEditor.vue

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
2-
<div class="h-100 w-100">
2+
<div class="h-100 w-75 mx-auto">
33
<div v-for="(cell, cellIndex) of cells" :key="cellIndex">
44
<CellButtonAdd :cell-index="cellIndex" @click="onClick" />
55
<hr class="solid m-0" />
6-
<div class="cell-card d-flex rounded my-1 mx-3">
7-
<span class="small text-primary">{{ cell.name }}</span>
6+
<div class="d-flex my-1 mx-3">
7+
<span class="cell-name small text-primary">{{ cell.name }}</span>
88
<CellCode :model-value="cell.content" class="ml-2" />
99
</div>
1010
<hr class="solid m-0" />
@@ -37,14 +37,8 @@ function onClick(cellIndex: number, cellType: string) {
3737
}
3838
</script>
3939

40-
<style lang="scss">
41-
@import "theme/blue.scss";
42-
43-
.cell-card {
44-
//background: $gray-100;
45-
.cell-card-header {
46-
background: lighten($brand-info, 20%);
47-
color: $white;
48-
}
40+
<style scoped>
41+
.cell-name {
42+
width: 3rem;
4943
}
5044
</style>

0 commit comments

Comments
 (0)