Merge branch 'feature/files' of github.com:ONLYOFFICE/AppServer into feature/files
This commit is contained in:
commit
d731e2cafa
@ -11,7 +11,8 @@ class SortComboBox extends React.Component {
|
|||||||
const { sortDirection } = props;
|
const { sortDirection } = props;
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
sortDirection
|
sortDirection,
|
||||||
|
opened: false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.combobox = React.createRef();
|
this.combobox = React.createRef();
|
||||||
@ -28,6 +29,7 @@ class SortComboBox extends React.Component {
|
|||||||
onChangeSortId = (e) => {
|
onChangeSortId = (e) => {
|
||||||
const { onChangeSortId } = this.props;
|
const { onChangeSortId } = this.props;
|
||||||
typeof onChangeSortId === 'function' && onChangeSortId(e.target.value);
|
typeof onChangeSortId === 'function' && onChangeSortId(e.target.value);
|
||||||
|
this.setState({ opened: !this.state.opened });
|
||||||
}
|
}
|
||||||
|
|
||||||
onChangeView = (e) => {
|
onChangeView = (e) => {
|
||||||
@ -38,7 +40,7 @@ class SortComboBox extends React.Component {
|
|||||||
onChangeSortDirection = (e) => {
|
onChangeSortDirection = (e) => {
|
||||||
const sortDirection = +e.target.value;
|
const sortDirection = +e.target.value;
|
||||||
const { onChangeSortDirection } = this.props;
|
const { onChangeSortDirection } = this.props;
|
||||||
this.setState({ sortDirection });
|
this.setState({ sortDirection, opened: !this.state.opened });
|
||||||
typeof onChangeSortDirection === 'function' && onChangeSortDirection(sortDirection);
|
typeof onChangeSortDirection === 'function' && onChangeSortDirection(sortDirection);
|
||||||
}
|
}
|
||||||
shouldComponentUpdate(nextProps, nextState) {
|
shouldComponentUpdate(nextProps, nextState) {
|
||||||
@ -58,10 +60,17 @@ class SortComboBox extends React.Component {
|
|||||||
}
|
}
|
||||||
return (!isEqual(this.props, nextProps) || !isEqual(this.state, nextState));
|
return (!isEqual(this.props, nextProps) || !isEqual(this.state, nextState));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onToggleAction = () => {
|
||||||
|
this.setState({
|
||||||
|
opened: !this.state.opened
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { options, directionAscLabel, directionDescLabel, isDisabled,
|
const { options, directionAscLabel, directionDescLabel, isDisabled,
|
||||||
selectedOption, viewAs } = this.props;
|
selectedOption, viewAs } = this.props;
|
||||||
const { sortDirection } = this.state;
|
const { sortDirection, opened } = this.state;
|
||||||
|
|
||||||
let settingsArray = options.filter(item => {
|
let settingsArray = options.filter(item => {
|
||||||
item.value = item.key
|
item.value = item.key
|
||||||
@ -126,6 +135,8 @@ class SortComboBox extends React.Component {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<ComboBox
|
<ComboBox
|
||||||
|
opened={opened}
|
||||||
|
toggleAction={this.onToggleAction}
|
||||||
advancedOptions={advancedOptions}
|
advancedOptions={advancedOptions}
|
||||||
className='styled-sort-combobox'
|
className='styled-sort-combobox'
|
||||||
directionX="right"
|
directionX="right"
|
||||||
|
Loading…
Reference in New Issue
Block a user