mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
fix-open-scroll (#2602)
This commit is contained in:
@@ -20,6 +20,7 @@ const propTypes = {
|
|||||||
lastModified: PropTypes.string,
|
lastModified: PropTypes.string,
|
||||||
latestContributor: PropTypes.string,
|
latestContributor: PropTypes.string,
|
||||||
permission: PropTypes.string,
|
permission: PropTypes.string,
|
||||||
|
hash: PropTypes.string,
|
||||||
path: PropTypes.string.isRequired,
|
path: PropTypes.string.isRequired,
|
||||||
// whether the file or dir corresponding to the path exist
|
// whether the file or dir corresponding to the path exist
|
||||||
pathExist: PropTypes.bool.isRequired,
|
pathExist: PropTypes.bool.isRequired,
|
||||||
@@ -82,6 +83,12 @@ class MainPanel extends Component {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.getTitlesInfo();
|
that.getTitlesInfo();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
if (this.props.hash) {
|
||||||
|
let hash = this.props.hash;
|
||||||
|
setTimeout(function() {
|
||||||
|
window.location.hash = hash;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switchViewMode = (mode) => {
|
switchViewMode = (mode) => {
|
||||||
|
@@ -42,6 +42,14 @@ class Wiki extends Component {
|
|||||||
selectedDirentList: [],
|
selectedDirentList: [],
|
||||||
};
|
};
|
||||||
window.onpopstate = this.onpopstate;
|
window.onpopstate = this.onpopstate;
|
||||||
|
this.hash = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
const hash = window.location.hash;
|
||||||
|
if (hash.slice(0, 1) === '#') {
|
||||||
|
this.hash = hash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -775,6 +783,7 @@ class Wiki extends Component {
|
|||||||
onItemsMove={this.onMoveItems}
|
onItemsMove={this.onMoveItems}
|
||||||
onItemsCopy={this.onCopyItems}
|
onItemsCopy={this.onCopyItems}
|
||||||
onItemsDelete={this.onDeleteItems}
|
onItemsDelete={this.onDeleteItems}
|
||||||
|
hash={this.hash}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user