Просмотр исходного кода

change how to watch which is Editor or View

yusuketk 7 лет назад
Родитель
Сommit
12e06fe7b3
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      src/client/js/components/Page/TagLabel.jsx

+ 2 - 3
src/client/js/components/Page/TagLabel.jsx

@@ -48,10 +48,9 @@ class TagLabel extends React.Component {
   }
   }
 
 
   async handleSubmit() {
   async handleSubmit() {
-    // eslint-disable-next-line no-restricted-globals
-    const isPageEditor = location.href.slice(-5) === '#edit';
+    const editorMode = this.props.crowi.getCrowiForJquery().getCurrentEditorMode();
 
 
-    if (isPageEditor) { // set tag on draft on edit
+    if (editorMode) { // set tag on draft on edit
       this.props.sendTagData(this.state.newPageTags);
       this.props.sendTagData(this.state.newPageTags);
     }
     }
     else { // update tags without saving the page on view
     else { // update tags without saving the page on view