mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-15 10:39:47 +02:00
parent
0df464ac03
commit
73e6db9a12
@ -144,6 +144,7 @@ class FileBrowserModalContent extends Component {
|
|||||||
<Scroller
|
<Scroller
|
||||||
ref={this.setScrollerRef}
|
ref={this.setScrollerRef}
|
||||||
className={styles.scroller}
|
className={styles.scroller}
|
||||||
|
scrollDirection={scrollDirections.BOTH}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
!!error &&
|
!!error &&
|
||||||
@ -152,7 +153,10 @@ class FileBrowserModalContent extends Component {
|
|||||||
|
|
||||||
{
|
{
|
||||||
isPopulated && !error &&
|
isPopulated && !error &&
|
||||||
<Table columns={columns}>
|
<Table
|
||||||
|
horizontalScroll={false}
|
||||||
|
columns={columns}
|
||||||
|
>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{
|
{
|
||||||
emptyParent &&
|
emptyParent &&
|
||||||
|
@ -48,7 +48,7 @@ ModalBody.propTypes = {
|
|||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
innerClassName: PropTypes.string,
|
innerClassName: PropTypes.string,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
scrollDirection: PropTypes.oneOf([scrollDirections.NONE, scrollDirections.HORIZONTAL, scrollDirections.VERTICAL])
|
scrollDirection: PropTypes.oneOf(scrollDirections.all)
|
||||||
};
|
};
|
||||||
|
|
||||||
ModalBody.defaultProps = {
|
ModalBody.defaultProps = {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
@add-mixin scrollbar;
|
@add-mixin scrollbar;
|
||||||
@add-mixin scrollbarTrack;
|
@add-mixin scrollbarTrack;
|
||||||
@add-mixin scrollbarThumb;
|
@add-mixin scrollbarThumb;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
}
|
}
|
||||||
|
|
||||||
.none {
|
.none {
|
||||||
@ -26,3 +27,11 @@
|
|||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.both {
|
||||||
|
overflow: scroll;
|
||||||
|
|
||||||
|
&.autoScroll {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -66,7 +66,7 @@ class Scroller extends Component {
|
|||||||
|
|
||||||
Scroller.propTypes = {
|
Scroller.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
scrollDirection: PropTypes.oneOf([scrollDirections.NONE, scrollDirections.HORIZONTAL, scrollDirections.VERTICAL]).isRequired,
|
scrollDirection: PropTypes.oneOf(scrollDirections.all).isRequired,
|
||||||
autoScroll: PropTypes.bool.isRequired,
|
autoScroll: PropTypes.bool.isRequired,
|
||||||
scrollTop: PropTypes.number,
|
scrollTop: PropTypes.number,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
.tableContainer {
|
.tableContainer {
|
||||||
overflow-x: auto;
|
&.horizontalScroll {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
@ -10,7 +12,12 @@
|
|||||||
|
|
||||||
@media only screen and (max-width: $breakpointSmall) {
|
@media only screen and (max-width: $breakpointSmall) {
|
||||||
.tableContainer {
|
.tableContainer {
|
||||||
overflow-y: hidden;
|
min-width: 100%;
|
||||||
width: 100%;
|
width: fit-content;
|
||||||
|
|
||||||
|
&.horizontalScroll {
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
import { icons, scrollDirections } from 'Helpers/Props';
|
import { icons, scrollDirections } from 'Helpers/Props';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
import Scroller from 'Components/Scroller/Scroller';
|
import Scroller from 'Components/Scroller/Scroller';
|
||||||
@ -28,6 +29,7 @@ function getTableHeaderCellProps(props) {
|
|||||||
function Table(props) {
|
function Table(props) {
|
||||||
const {
|
const {
|
||||||
className,
|
className,
|
||||||
|
horizontalScroll,
|
||||||
selectAll,
|
selectAll,
|
||||||
columns,
|
columns,
|
||||||
optionsComponent,
|
optionsComponent,
|
||||||
@ -41,14 +43,22 @@ function Table(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Scroller
|
<Scroller
|
||||||
className={styles.tableContainer}
|
className={classNames(
|
||||||
scrollDirection={scrollDirections.HORIZONTAL}
|
styles.tableContainer,
|
||||||
|
horizontalScroll && styles.horizontalScroll
|
||||||
|
)}
|
||||||
|
scrollDirection={
|
||||||
|
horizontalScroll ?
|
||||||
|
scrollDirections.HORIZONTAL :
|
||||||
|
scrollDirections.NONE
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<table className={className}>
|
<table className={className}>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
{
|
{
|
||||||
selectAll &&
|
selectAll ?
|
||||||
<TableSelectAllHeaderCell {...otherProps} />
|
<TableSelectAllHeaderCell {...otherProps} /> :
|
||||||
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -111,6 +121,7 @@ function Table(props) {
|
|||||||
|
|
||||||
Table.propTypes = {
|
Table.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
|
horizontalScroll: PropTypes.bool.isRequired,
|
||||||
selectAll: PropTypes.bool.isRequired,
|
selectAll: PropTypes.bool.isRequired,
|
||||||
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||||
optionsComponent: PropTypes.elementType,
|
optionsComponent: PropTypes.elementType,
|
||||||
@ -123,6 +134,7 @@ Table.propTypes = {
|
|||||||
|
|
||||||
Table.defaultProps = {
|
Table.defaultProps = {
|
||||||
className: styles.table,
|
className: styles.table,
|
||||||
|
horizontalScroll: true,
|
||||||
selectAll: false
|
selectAll: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
export const NONE = 'none';
|
export const NONE = 'none';
|
||||||
|
export const BOTH = 'both';
|
||||||
export const HORIZONTAL = 'horizontal';
|
export const HORIZONTAL = 'horizontal';
|
||||||
export const VERTICAL = 'vertical';
|
export const VERTICAL = 'vertical';
|
||||||
|
|
||||||
export const all = [NONE, HORIZONTAL, VERTICAL];
|
export const all = [NONE, HORIZONTAL, VERTICAL, BOTH];
|
||||||
|
@ -5,7 +5,7 @@ import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
|||||||
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
||||||
import selectAll from 'Utilities/Table/selectAll';
|
import selectAll from 'Utilities/Table/selectAll';
|
||||||
import toggleSelected from 'Utilities/Table/toggleSelected';
|
import toggleSelected from 'Utilities/Table/toggleSelected';
|
||||||
import { align, icons, kinds } from 'Helpers/Props';
|
import { align, icons, kinds, scrollDirections } from 'Helpers/Props';
|
||||||
import Button from 'Components/Link/Button';
|
import Button from 'Components/Link/Button';
|
||||||
import Icon from 'Components/Icon';
|
import Icon from 'Components/Icon';
|
||||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||||
@ -246,7 +246,7 @@ class InteractiveImportModalContent extends Component {
|
|||||||
Manual Import - {title || folder}
|
Manual Import - {title || folder}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody scrollDirection={scrollDirections.BOTH}>
|
||||||
{
|
{
|
||||||
showFilterExistingFiles &&
|
showFilterExistingFiles &&
|
||||||
<div className={styles.filterContainer}>
|
<div className={styles.filterContainer}>
|
||||||
@ -299,6 +299,7 @@ class InteractiveImportModalContent extends Component {
|
|||||||
isPopulated && !!items.length && !isFetching && !isFetching &&
|
isPopulated && !!items.length && !isFetching && !isFetching &&
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
horizontalScroll={false}
|
||||||
selectAll={true}
|
selectAll={true}
|
||||||
allSelected={allSelected}
|
allSelected={allSelected}
|
||||||
allUnselected={allUnselected}
|
allUnselected={allUnselected}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { scrollDirections } from 'Helpers/Props';
|
||||||
import Button from 'Components/Link/Button';
|
import Button from 'Components/Link/Button';
|
||||||
import ModalContent from 'Components/Modal/ModalContent';
|
import ModalContent from 'Components/Modal/ModalContent';
|
||||||
import ModalHeader from 'Components/Modal/ModalHeader';
|
import ModalHeader from 'Components/Modal/ModalHeader';
|
||||||
@ -21,7 +22,7 @@ function SeasonInteractiveSearchModalContent(props) {
|
|||||||
Interactive Search {seasonNumber != null && <SeasonNumber seasonNumber={seasonNumber} />}
|
Interactive Search {seasonNumber != null && <SeasonNumber seasonNumber={seasonNumber} />}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody scrollDirection={scrollDirections.BOTH}>
|
||||||
<InteractiveSearchConnector
|
<InteractiveSearchConnector
|
||||||
type="season"
|
type="season"
|
||||||
searchPayload={{
|
searchPayload={{
|
||||||
|
Loading…
Reference in New Issue
Block a user