mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-10 19:29:56 +00:00
[favicon] use file type icon as favicon for 'file view, shared file view' pages for different types of files (#5775)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import { SimpleEditor } from '@seafile/sdoc-editor';
|
||||
import ExternalOperations from './external-operations';
|
||||
import { Utils } from '../../../utils/utils';
|
||||
|
||||
export default class SdocEditor extends React.Component {
|
||||
|
||||
@@ -13,6 +14,12 @@ export default class SdocEditor extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { docName } = window.seafile;
|
||||
const fileIcon = Utils.getFileIconUrl(docName, 192);
|
||||
document.getElementById('favicon').href = fileIcon;
|
||||
}
|
||||
|
||||
toggleStar = (isStarred) => {
|
||||
this.setState({isStarred: isStarred});
|
||||
};
|
||||
|
Reference in New Issue
Block a user