Skip to content

Commit

Permalink
fix(editor): Fix outline visibility
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Nov 1, 2023
1 parent 44170f2 commit 7736a35
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
20 changes: 16 additions & 4 deletions cypress/e2e/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,28 +283,40 @@ describe('Page', function() {
it('Allows to toggle persistent full-width view', function() {
cy.openPage('Day 2')
cy.get('#titleform').should('have.css', 'max-width', '100%')
cy.getReadOnlyEditor().invoke('outerWidth').should('eq', 670)
cy.getReadOnlyEditor()
.find('.editor__content')
.invoke('outerWidth')
.should('eq', 670)

// Set full width mode
cy.get('#titleform .action-item__menutoggle')
.click()
cy.contains('li.action', 'Full width')
.click()
cy.get('#titleform').should('have.css', 'max-width', 'none')
cy.getReadOnlyEditor().invoke('outerWidth').should('be.greaterThan', 700)
cy.getReadOnlyEditor()
.find('.editor__content')
.invoke('outerWidth')
.should('be.greaterThan', 700)

// Reload to check persistence with browser storage
cy.reload()
cy.get('#titleform').should('have.css', 'max-width', 'none')
cy.getReadOnlyEditor().invoke('outerWidth').should('be.greaterThan', 700)
cy.getReadOnlyEditor()
.find('.editor__content')
.invoke('outerWidth')
.should('be.greaterThan', 700)

// Unset full width mode
cy.get('#titleform .action-item__menutoggle')
.click()
cy.contains('li.action', 'Full width')
.click()
cy.get('#titleform').should('have.css', 'max-width', '100%')
cy.getReadOnlyEditor().invoke('outerWidth').should('eq', 670)
cy.getReadOnlyEditor()
.find('.editor__content')
.invoke('outerWidth')
.should('eq', 670)
})
})

Expand Down
13 changes: 13 additions & 0 deletions src/css/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
max-width: var(--text-editor-max-width);
margin: auto;

&[data-collectives-el='editor'],
&[data-collectives-el='reader'] {
max-width: unset;
}

&.page-title {
max-width: 100%;
margin: 0 0 0 max(0px, calc(50% - (var(--text-editor-max-width) / 2)));
Expand All @@ -24,3 +29,11 @@
margin: auto;
}
}

/* TODO: remove once https://github.com/nextcloud/text/pull/4945 got released */
.editor--outline {
border-radius: var(--border-radius-large);
box-shadow: 0 1px 10px var(--color-box-shadow);
background-color: var(--color-main-background);
z-index: 10021;
}

0 comments on commit 7736a35

Please sign in to comment.