File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 cursor pointer
1414 transition background-color 0.15s
1515 & :hover
16- background-color alpha (black , 5 % )
16+ background-color alpha ($ui-active-color , 10 % )
1717
1818.item--active
1919 @extend .item
3333 font-size 12px
3434 color $ui-inactive-text-color
3535 line-height 30px
36+ overflow-y hidden
3637
3738.item-info-left
3839 float left
40+ overflow ellipsis
3941
4042.item-info-right
4143 float right
5254 font-size 12px
5355 line-height 30px
5456 color $ui-inactive-text-color
57+ overflow ellipsis
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ class NoteList extends React.Component {
2929 }
3030
3131 componentDidUpdate ( ) {
32+ let { location } = this . props
33+ if ( this . notes . length > 0 && location . query . key == null ) {
34+ let { router } = this . context
35+ router . replace ( {
36+ pathname : location . pathname ,
37+ query : {
38+ key : `${ this . notes [ 0 ] . _repository . key } -${ this . notes [ 0 ] . key } `
39+ }
40+ } )
41+ }
3242 // return false
3343 // var index = articles.indexOf(null)
3444 // var el = ReactDOM.findDOMNode(this)
@@ -175,13 +185,13 @@ class NoteList extends React.Component {
175185
176186 render ( ) {
177187 let { location } = this . props
178- let notes = this . getNotes ( )
188+ let notes = this . notes = this . getNotes ( )
179189 let noteElements = notes . map ( ( note ) => {
180190 let folder = _ . find ( note . _repository . folders , { key : note . folder } )
181191 let tagElements = note . tags . map ( ( tag ) => {
182192 return < span key = 'tag' > { tag } </ span >
183193 } )
184- let key = `${ note . _repository . key } / ${ note . key } `
194+ let key = `${ note . _repository . key } - ${ note . key } `
185195 let isActive = location . query . key === key
186196 return (
187197 < div styleName = { isActive
You can’t perform that action at this time.
0 commit comments