diff --git a/app/react/App/scss/elements/_pdfViewer.scss b/app/react/App/scss/elements/_pdfViewer.scss new file mode 100644 index 0000000000..e5d50dc24a --- /dev/null +++ b/app/react/App/scss/elements/_pdfViewer.scss @@ -0,0 +1,22 @@ +#pdf-container { + margin: auto; + width: fit-content; + + .pdf-page { + position: relative; + } + + & .canvasWrapper { + margin: 0; + display: block; + width: 100%; + height: 100%; + + & canvas { + margin: 0; + display: block; + width: 100%; + height: 100%; + } + } +} diff --git a/app/react/App/scss/styles.scss b/app/react/App/scss/styles.scss index 29d68d6e20..9b76d1da0b 100644 --- a/app/react/App/scss/styles.scss +++ b/app/react/App/scss/styles.scss @@ -13,6 +13,7 @@ @import 'elements/item'; @import 'elements/linkField'; @import 'elements/panel'; +@import 'elements/pdfViewer'; @import 'elements/breadcrumbs'; @import 'elements/draggable'; @import 'elements/dropdown'; diff --git a/app/react/Documents/components/ShowToc.js b/app/react/Documents/components/ShowToc.js index 2cd28e3433..65478a5393 100644 --- a/app/react/Documents/components/ShowToc.js +++ b/app/react/Documents/components/ShowToc.js @@ -2,23 +2,20 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { scrollToToc } from 'app/Viewer/actions/uiActions'; -import Immutable from 'immutable'; import ShowIf from 'app/App/ShowIf'; import { t } from 'app/I18N'; import { Icon } from 'UI'; - +import { selectionHandlers } from 'V2/Components/PDFViewer'; import './scss/showToc.scss'; -export class ShowToc extends Component { +class ShowToc extends Component { scrollTo(tocElement, e) { e.preventDefault(); - this.props.scrollToToc(tocElement.toJS()); + this.props.scrollToToc(tocElement); } render() { - const toc = Immutable.fromJS(this.props.toc); - - if (!toc.size) { + if (!this.props.toc.length) { return (