Procházet zdrojové kódy

change how to watch which is Editor or View

yusuketk před 7 roky
rodič
revize
12e06fe7b3
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  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() {
-    // 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);
     }
     else { // update tags without saving the page on view