kaori 5 лет назад
Родитель
Сommit
6ea994c8f8
2 измененных файлов с 5 добавлено и 3 удалено
  1. 2 2
      src/client/js/legacy/crowi.js
  2. 3 1
      src/client/js/services/PageContainer.js

+ 2 - 2
src/client/js/legacy/crowi.js

@@ -201,13 +201,13 @@ $(() => {
 
 window.addEventListener('load', (e) => {
   const { appContainer, pageContainer } = window;
-  const isEditableMode = pageContainer;
+  const editablePages = pageContainer;
 
   // hash on page
   if (window.location.hash) {
     const navigationContainer = appContainer.getContainer('NavigationContainer');
 
-    if (window.location.hash === '#edit' && isEditableMode) {
+    if (window.location.hash === '#edit' && editablePages) {
       navigationContainer.setEditorMode('edit');
 
       // focus

+ 3 - 1
src/client/js/services/PageContainer.js

@@ -133,7 +133,8 @@ export default class PageContainer extends Container {
     return 'PageContainer';
   }
 
-  isEditableMode() {
+
+  get editablePages() {
     const { appContainer } = window;
     const { currentUser } = appContainer;
     const {
@@ -143,6 +144,7 @@ export default class PageContainer extends Container {
     if (isPageExist && (currentUser != null) && !isPageForbidden && !isNotCreatable && !isTrashPage) {
       return true;
     }
+    return false;
   }
 
   /**