Skip to content

Commit 5809998

Browse files
committed
refactor: update edit menu icon appearance and editor setup function
1 parent 4e29cf6 commit 5809998

File tree

3 files changed

+54
-23
lines changed

3 files changed

+54
-23
lines changed

wiki/public/js/editor.js

+6-13
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,13 @@ previewToggleBtn.on("click", function () {
5555
});
5656

5757
function setEditor() {
58-
editor.setOption("wrap", true);
59-
editor.setOption("showPrintMargin", true);
60-
editor.setTheme("ace/theme/tomorrow_night");
61-
editor.renderer.lineHeight = 20;
62-
frappe.call({
63-
method: "wiki.wiki.doctype.wiki_page.wiki_page.convert_html",
64-
args: {
65-
html: $(".wiki-content").html(),
66-
},
67-
callback: (r) => {
68-
editor.setValue(markdown_content || "", 1);
69-
},
58+
editor.setOptions({
59+
wrap: true,
60+
showPrintMargin: true,
61+
theme: "ace/theme/tomorrow_night",
7062
});
71-
63+
editor.renderer.lineHeight = 20;
64+
editor.setValue(markdown_content || "", 1);
7265
wikiTitleInput.val($(".wiki-title").text() || "");
7366
}
7467

wiki/public/scss/wiki.scss

+44-6
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,21 @@ body {
4040

4141
// ------------------------------------------
4242

43-
font-family: InterVariable, ui-sans-serif, system-ui, -apple-system,
44-
BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans,
45-
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol,
43+
font-family:
44+
InterVariable,
45+
ui-sans-serif,
46+
system-ui,
47+
-apple-system,
48+
BlinkMacSystemFont,
49+
Segoe UI,
50+
Roboto,
51+
Helvetica Neue,
52+
Arial,
53+
Noto Sans,
54+
sans-serif,
55+
"Apple Color Emoji",
56+
"Segoe UI Emoji",
57+
Segoe UI Symbol,
4658
"Noto Color Emoji";
4759

4860
background-color: var(--background-color);
@@ -316,7 +328,10 @@ body.dark {
316328
&.active {
317329
background-color: var(--sidebar-active-item-color);
318330
border-radius: 0.625rem;
319-
box-shadow: 0 0 #0000, 0 0 #0000, 0px 1px 2px rgba(0, 0, 0, 0.1);
331+
box-shadow:
332+
0 0 #0000,
333+
0 0 #0000,
334+
0px 1px 2px rgba(0, 0, 0, 0.1);
320335
}
321336

322337
div {
@@ -858,9 +873,11 @@ h6:hover .feather-link {
858873
}
859874

860875
.wiki-options {
876+
display: flex;
877+
flex-direction: column;
878+
justify-content: center;
861879
width: 2rem;
862880
height: 2rem;
863-
margin-top: 0.5rem;
864881
margin-left: 0.5rem;
865882

866883
svg {
@@ -872,6 +889,24 @@ h6:hover .feather-link {
872889
}
873890
}
874891

892+
.menu {
893+
cursor: pointer;
894+
font-size: 24px;
895+
896+
.dots {
897+
display: flex;
898+
justify-content: space-around;
899+
width: 16px;
900+
901+
.dot {
902+
background-color: #333;
903+
border-radius: 50%;
904+
width: 6px;
905+
height: 6px;
906+
}
907+
}
908+
}
909+
875910
.wiki-options:hover {
876911
background-color: var(--gray-200);
877912
border-radius: 5px;
@@ -953,7 +988,10 @@ h6:hover .feather-link {
953988
.active {
954989
color: var(--text-color);
955990
box-shadow: 1px 0 0 var(--primary) inset;
956-
transition: color 0.2s, box-shadow 0.2s linear, transform 0.2s linear;
991+
transition:
992+
color 0.2s,
993+
box-shadow 0.2s linear,
994+
transform 0.2s linear;
957995
}
958996

959997
a {

wiki/wiki/doctype/wiki_page/templates/show.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ <h5 class="modal-title" id="addGroupModalTitle">Title</h5>
4444
</div>
4545
{%- endif -%}
4646
<div class="dropdown">
47-
<div class="dropdown-toggle wiki-options" type="button" role="button" id="wikiOptionsButton" data-toggle="dropdown"
47+
<div class="dropdown-toggle wiki-options menu" type="button" role="button" id="wikiOptionsButton" data-toggle="dropdown"
4848
aria-label="Wiki Option Button" aria-expanded="false">
4949
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
5050
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
51-
class="feather feather-more-vertical">
51+
class="feather feather-more-horizontal">
52+
<circle cx="5" cy="12" r="1"></circle>
5253
<circle cx="12" cy="12" r="1"></circle>
53-
<circle cx="12" cy="5" r="1"></circle>
54-
<circle cx="12" cy="19" r="1"></circle>
54+
<circle cx="19" cy="12" r="1"></circle>
5555
</svg>
5656
</div>
5757
<div class="dropdown-menu d-print-none" aria-labelledby="wikiOptionsButton">

0 commit comments

Comments
 (0)