mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
repair file view bug
This commit is contained in:
@@ -107,7 +107,7 @@ class App extends Component {
|
|||||||
let newWindow = window.open('markdown-editor');
|
let newWindow = window.open('markdown-editor');
|
||||||
newWindow.location.href = url;
|
newWindow.location.href = url;
|
||||||
} else {
|
} else {
|
||||||
let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + selectedItem.path;
|
let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
|
||||||
let newWindow = window.open('about:blank');
|
let newWindow = window.open('about:blank');
|
||||||
newWindow.location.href = url;
|
newWindow.location.href = url;
|
||||||
}
|
}
|
||||||
|
@@ -142,7 +142,7 @@ class ShareToGroup extends React.Component {
|
|||||||
let path = this.props.itemPath;
|
let path = this.props.itemPath;
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
if (this.props.isGroupOwnedRepo) {
|
if (this.props.isGroupOwnedRepo) {
|
||||||
seafileAPI.deleteGroupOwnedRepoGroupShared(repoID, groupID).then(() => {
|
seafileAPI.deleteGroupOwnedRepoSharedGroupItem(repoID, groupID).then(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
sharedItems: this.state.sharedItems.filter(item => { return item.group_info.id !== groupID; })
|
sharedItems: this.state.sharedItems.filter(item => { return item.group_info.id !== groupID; })
|
||||||
});
|
});
|
||||||
|
@@ -137,7 +137,7 @@ class ShareToUser extends React.Component {
|
|||||||
let path = this.props.itemPath;
|
let path = this.props.itemPath;
|
||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
if (this.props.isGroupOwnedRepo) {
|
if (this.props.isGroupOwnedRepo) {
|
||||||
seafileAPI.deleteGroupOwnedRepoUserShared(repoID, username).then(res => {
|
seafileAPI.deleteGroupOwnedRepoSharedUserItem(repoID, username).then(res => {
|
||||||
this.setState({
|
this.setState({
|
||||||
sharedItems: this.state.sharedItems.filter( item => { return item.user_info.name !== username; })
|
sharedItems: this.state.sharedItems.filter( item => { return item.user_info.name !== username; })
|
||||||
});
|
});
|
||||||
|
@@ -91,7 +91,7 @@ class DirView extends React.Component {
|
|||||||
window.history.pushState({url: fileUrl, path: direntPath}, direntPath, fileUrl);
|
window.history.pushState({url: fileUrl, path: direntPath}, direntPath, fileUrl);
|
||||||
} else {
|
} else {
|
||||||
const w=window.open('about:blank');
|
const w=window.open('about:blank');
|
||||||
const url = siteRoot + 'lib/' + this.state.repoID + '/file' + direntPath;
|
const url = siteRoot + 'lib/' + this.state.repoID + '/file' + Utils.encodePath(direntPath);
|
||||||
w.location.href = url;
|
w.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -300,7 +300,7 @@ class Wiki extends Component {
|
|||||||
this.showFile(node.path);
|
this.showFile(node.path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let url = siteRoot + 'lib/' + item.repo_id + '/file' + item.path;
|
let url = siteRoot + 'lib/' + item.repo_id + '/file' + Utils.encodePath(item.path);
|
||||||
let newWindow = window.open('about:blank');
|
let newWindow = window.open('about:blank');
|
||||||
newWindow.location.href = url;
|
newWindow.location.href = url;
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ class Wiki extends Component {
|
|||||||
this.showDir(node.path);
|
this.showDir(node.path);
|
||||||
} else {
|
} else {
|
||||||
const w=window.open('about:blank');
|
const w=window.open('about:blank');
|
||||||
const url = siteRoot + 'lib/' + repoID + '/file' + node.path;
|
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||||
w.location.href = url;
|
w.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -133,7 +133,7 @@ class Wiki extends Component {
|
|||||||
this.enterViewFileState(tree, node, node.path);
|
this.enterViewFileState(tree, node, node.path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let url = siteRoot + 'lib/' + item.repo_id + '/file' + item.path;
|
let url = siteRoot + 'lib/' + item.repo_id + '/file' + Utils.encodePath(item.path);
|
||||||
let newWindow = window.open('about:blank');
|
let newWindow = window.open('about:blank');
|
||||||
newWindow.location.href = url;
|
newWindow.location.href = url;
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ class Wiki extends Component {
|
|||||||
this.exitViewFileState(tree, node);
|
this.exitViewFileState(tree, node);
|
||||||
} else {
|
} else {
|
||||||
const w=window.open('about:blank');
|
const w=window.open('about:blank');
|
||||||
const url = siteRoot + 'lib/' + repoID + '/file' + node.path;
|
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
|
||||||
w.location.href = url;
|
w.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user