Przeglądaj źródła

Merge pull request #2174 from weseek/fix/warning-in-search-result-page

Fix/warning in search result page
yusuketk 5 lat temu
rodzic
commit
dc0b7c4c85

+ 9 - 2
src/client/js/components/SearchPage/SearchResult.jsx

@@ -41,6 +41,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
    *
@@ -197,7 +204,7 @@ class SearchResult extends React.Component {
                 )
               }
               <div className="page-list-option">
-                <button type="button" className="btn btn-link p-0" 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>
@@ -285,7 +292,7 @@ class SearchResult extends React.Component {
     return (
       <div className="content-main">
         <div className="search-result row" id="search-result">
-          <div className="col-lg-4 d-none d-lg-block page-list search-result-list" id="search-result-list">
+          <div className="col-lg-4 d-none d-lg-block page-list search-result-list pr-0" id="search-result-list">
             <nav>
               <div className="d-flex align-items-start justify-content-between mt-1">
                 <div className="search-result-meta">

+ 16 - 11
src/client/styles/scss/_search.scss

@@ -121,17 +121,22 @@
     overflow-y: scroll;
 
     .nav.nav-pills {
-      > li > a {
-        padding: 2px 8px;
-        border-radius: 0;
-
-        &:hover {
-          color: inherit;
-          text-decoration: none;
-        }
-        &.active {
-          padding: 2px 5px;
-          border-right: solid 3px transparent;
+      > li {
+        > a {
+          padding: 2px 8px;
+          border-radius: 0;
+
+          &:hover {
+            color: inherit;
+            text-decoration: none;
+          }
+          &.active {
+            padding-right: 5px;
+            border-right: solid 3px transparent;
+          }
+          > * {
+            margin-right: 3px;
+          }
         }
       }
     }