yusuketk 5 лет назад
Родитель
Сommit
80d7e203aa
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      src/client/js/components/SearchPage/SearchResult.jsx

+ 8 - 1
src/client/js/components/SearchPage/SearchResult.jsx

@@ -39,6 +39,13 @@ class SearchResult extends React.Component {
     return false;
   }
 
+  /**
+   * move the page
+   */
+  visitPageButtonHandler(e) {
+    window.location.href = e.currentTarget.value;
+  }
+
   /**
    * toggle checkbox and add (or delete from) selected pages list
    *
@@ -195,7 +202,7 @@ class SearchResult extends React.Component {
                 )
               }
               <div className="page-list-option">
-                <button type="button" className="btn btn-link p-0" onClick={() => { window.location.href = page.path }}><i className="icon-login" /></button>
+                <button type="button" className="btn btn-link p-0" value={page.path} onClick={this.visitPageButtonHandler}><i className="icon-login" /></button>
               </div>
             </div>
           </a>