1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-02-10 14:31:41 +00:00

Key入力追加

This commit is contained in:
Rokt33r
2015-10-31 18:21:42 +09:00
parent 3d0b79f674
commit 954e148be3
10 changed files with 164 additions and 31 deletions

View File

@@ -15,6 +15,26 @@ export default class ArticleList extends React.Component {
clearInterval(this.refreshTimer)
}
selectPriorArticle () {
let { articles, activeArticle, dispatch } = this.props
let targetIndex = articles.indexOf(activeArticle) - 1
let targetArticle = articles[targetIndex]
if (targetArticle != null) {
dispatch(switchArticle(targetArticle.key))
}
}
selectNextArticle () {
let { articles, activeArticle, dispatch } = this.props
let targetIndex = articles.indexOf(activeArticle) + 1
let targetArticle = articles[targetIndex]
if (targetArticle != null) {
dispatch(switchArticle(targetArticle.key))
}
}
handleArticleClick (article) {
let { dispatch } = this.props
return function (e) {