diff --git a/frontend/src/pages/wiki2/index.js b/frontend/src/pages/wiki2/index.js index f1dacc7833..387f66932b 100644 --- a/frontend/src/pages/wiki2/index.js +++ b/frontend/src/pages/wiki2/index.js @@ -198,6 +198,7 @@ class Wiki extends Component { callback && callback(); }); this.cacheHistoryFiles(docUuid, name, id); + this.updateDocumentTitle(name); }; onUpdatePage = (pageId, newPage) => { @@ -205,6 +206,9 @@ class Wiki extends Component { toaster.danger(gettext('Page name cannot be empty')); return; } + if (this.state.currentPageId === pageId) { + this.updateDocumentTitle(newPage.name); + } const { config } = this.state; let pages = config.pages; let newPages = pages.map(page => { @@ -217,6 +221,10 @@ class Wiki extends Component { this.saveWikiConfig(newConfig); }; + updateDocumentTitle = (newTitle) => { + document.title = newTitle; + }; + render() { return (
diff --git a/frontend/src/pages/wiki2/wiki-right-header/page-title.js b/frontend/src/pages/wiki2/wiki-right-header/page-title.js index 8b2d2fcd03..56527f62f6 100644 --- a/frontend/src/pages/wiki2/wiki-right-header/page-title.js +++ b/frontend/src/pages/wiki2/wiki-right-header/page-title.js @@ -4,7 +4,7 @@ import classnames from 'classnames'; import { Input } from 'reactstrap'; import { gettext } from '../../../utils/constants'; import { WIKI_COVER_LIST } from '../constant'; -import HeaderIcon from './page-icon'; +import PageIcon from './page-icon'; import { generateARandomEmoji, generateEmojiIcon } from '../utils/emoji-utils'; import './page-title.css'; @@ -63,7 +63,7 @@ const PageTitle = ({ currentPageConfig, onUpdatePage }) => { return (
{currentPageConfig.icon && ( - + )}
{!currentPageConfig.icon && ( diff --git a/seahub/templates/wiki/wiki_edit.html b/seahub/templates/wiki/wiki_edit.html index 97358d4ae9..630b1787bd 100644 --- a/seahub/templates/wiki/wiki_edit.html +++ b/seahub/templates/wiki/wiki_edit.html @@ -16,7 +16,7 @@ {% render_bundle 'wiki2' 'css' %} {% endblock %} -{% block wiki_title %} {{h1_head_content}} - {{repo_name}}{% endblock %} +{% block wiki_title %}{{repo_name}}{% endblock %} {% block extra_script %}