mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
change mouse enter logic
This commit is contained in:
@@ -6,8 +6,6 @@ import { Utils } from '../../utils/utils';
|
|||||||
const propTypes = {
|
const propTypes = {
|
||||||
item: PropTypes.object.isRequired,
|
item: PropTypes.object.isRequired,
|
||||||
onItemClickHandler: PropTypes.func.isRequired,
|
onItemClickHandler: PropTypes.func.isRequired,
|
||||||
onMouseEnter: PropTypes.func,
|
|
||||||
onMouseLeave: PropTypes.func,
|
|
||||||
isHighlight: PropTypes.bool,
|
isHighlight: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -31,8 +29,6 @@ class SearchResultItem extends React.Component {
|
|||||||
<li
|
<li
|
||||||
className={classnames('search-result-item', {'search-result-item-highlight': this.props.isHighlight })}
|
className={classnames('search-result-item', {'search-result-item-highlight': this.props.isHighlight })}
|
||||||
onClick={this.onClickHandler}
|
onClick={this.onClickHandler}
|
||||||
onMouseEnter={this.props.onMouseEnter}
|
|
||||||
onMouseLeave={this.props.onMouseLeave}
|
|
||||||
>
|
>
|
||||||
<img className={item.link_content ? 'item-img' : 'lib-item-img'} src={fileIconUrl} alt="" />
|
<img className={item.link_content ? 'item-img' : 'lib-item-img'} src={fileIconUrl} alt="" />
|
||||||
<div className="item-content">
|
<div className="item-content">
|
||||||
|
@@ -307,8 +307,6 @@ class Search extends Component {
|
|||||||
key={index}
|
key={index}
|
||||||
item={item}
|
item={item}
|
||||||
onItemClickHandler={this.onItemClickHandler}
|
onItemClickHandler={this.onItemClickHandler}
|
||||||
onMouseEnter={(e) => this.setState({ highlightIndex: index })}
|
|
||||||
onMouseLeave={(e) => this.setState({ highlightIndex: -1 })}
|
|
||||||
isHighlight={index === highlightIndex}
|
isHighlight={index === highlightIndex}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@@ -105,6 +105,7 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-result-container .search-result-item:hover,
|
||||||
.search-result-container .search-result-item.search-result-item-highlight {
|
.search-result-container .search-result-item.search-result-item-highlight {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user