Przeglądaj źródła

success to use editable pages

kaori 5 lat temu
rodzic
commit
6ea994c8f8

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

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

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

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