Skip to content

Commit c751073

Browse files
authored
Merge pull request #2920 from nextcloud/2904-table-of-contents-add-button-to-close-outline-from-itself
Able to show outiline in readonly mode
2 parents faab200 + 62d7b8f commit c751073

23 files changed

Lines changed: 211 additions & 97 deletions

css/print.scss

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@media print {
22
@page {
33
size: A4;
4-
margin: 2.5cm 2cm 2cm 2.5cm;
4+
margin: 2.5cm 2cm 2cm 2.5cm;
55
}
66

77
body {
@@ -81,4 +81,24 @@
8181
}
8282
}
8383
}
84-
}
84+
85+
.menubar-placeholder, .text-editor--readonly-bar {
86+
display: none;
87+
}
88+
89+
.text-editor__content-wrapper {
90+
&.--show-outline {
91+
display: block;
92+
}
93+
94+
.editor--outline {
95+
width: auto;
96+
height: auto;
97+
overflow: unset;
98+
position: relative;
99+
}
100+
.editor--outline__btn-close {
101+
display: none;
102+
}
103+
}
104+
}

css/prosemirror.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ div.ProseMirror {
8888
margin-top: 10px;
8989
}
9090

91+
> h1,h2,h3,h4,h5,h6 {
92+
&:first-child {
93+
margin-top: 0;
94+
}
95+
}
96+
9197
a {
9298
color: var(--color-primary-element);
9399
text-decoration: underline;

cypress/e2e/share.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ describe('Open test.md in viewer', function() {
5555
cy.getContent()
5656
.should('contain', 'Hello world')
5757
.find('h2').should('contain', 'Hello world')
58+
59+
cy.get('.text-editor--readonly-bar')
60+
.getActionEntry('outline')
61+
.click()
62+
63+
cy.getOutline()
64+
.find('header')
65+
.should('exist')
5866
})
5967
})
6068

js/editor-rich.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/editor-rich.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/editor.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/editor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/files-modal.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/files-modal.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-files.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)