1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

add planet/user tooltip

This commit is contained in:
Rokt33r
2015-07-25 02:23:21 +09:00
parent 465b315ae0
commit bea9dfdfc7
4 changed files with 37 additions and 2 deletions

View File

@@ -23,7 +23,10 @@ var PlanetNavigator = React.createClass({
render: function () {
var users = this.props.currentPlanet.Users.map(function (user) {
return (
<li key={'user-' + user.id}><img width='44' height='44' src='../vendor/dummy.jpg'/></li>
<li key={'user-' + user.id}>
<img width='44' height='44' src='../vendor/dummy.jpg'/>
<div className='userTooltip'>{user.profileName}</div>
</li>
)
})

View File

@@ -44,7 +44,10 @@ module.exports = React.createClass({
var planets = this.props.currentUser.Planets.map(function (planet, index) {
return (
<li key={planet.id} className={this.props.currentPlanet != null && this.props.currentPlanet.name === planet.name ? 'active' : ''}>
<Link to='planet' params={{userName: planet.userName, planetName: planet.name}} href>{planet.name[0]}</Link>
<Link to='planet' params={{userName: planet.userName, planetName: planet.name}} href>
{planet.name[0]}
<div className='planetTooltip'>{planet.userName}/{planet.name}</div>
</Link>
<div className='shortCut'>{index + 1}</div>
</li>
)

View File

@@ -135,6 +135,20 @@
circle()
margin 3px
line-height 44px
.userTooltip
position absolute
z-index 500
background-color transparentify(invBackgroundColor, 80%)
color invTextColor
padding 10px
line-height 1em
border-radius 5px
margin-top -15px
opacity 0
transition 0.1s
pointer-events none
&:hover .userTooltip
opacity 1
.PlanetArticleList

View File

@@ -46,6 +46,21 @@
transition 0.1s
&:hover, &:active
background-color white
.planetTooltip
position absolute
z-index 500
background-color transparentify(invBackgroundColor, 80%)
color invTextColor
padding 10px
line-height 1em
border-radius 5px
margin-top -41px
margin-left 52px
opacity 0
transition 0.1s
pointer-events none
&:hover .planetTooltip
opacity 1
img
circle()
width 44px