mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
実装 - PlanetArticleListへのAuto scroll追加
This commit is contained in:
@@ -76,7 +76,7 @@ module.exports = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span className='itemControl'>
|
<span className='itemControl'>
|
||||||
<button onClick={this.openEditModal} className='editButton'>
|
<button id='articleEditButton' onClick={this.openEditModal} className='editButton'>
|
||||||
<i className='fa fa-edit fa-fw'></i>
|
<i className='fa fa-edit fa-fw'></i>
|
||||||
<div className='tooltip'>Edit</div>
|
<div className='tooltip'>Edit</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -107,7 +107,7 @@ module.exports = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span className='itemControl'>
|
<span className='itemControl'>
|
||||||
<button onClick={this.openEditModal} className='editButton'>
|
<button id='articleEditButton' onClick={this.openEditModal} className='editButton'>
|
||||||
<i className='fa fa-edit fa-fw'></i>
|
<i className='fa fa-edit fa-fw'></i>
|
||||||
<div className='tooltip'>Edit</div>
|
<div className='tooltip'>Edit</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
handleArticleClikck: function (article) {
|
handleArticleClikck: function (article) {
|
||||||
if (article.type === 'code') {
|
if (article.type === 'code') {
|
||||||
return function () {
|
return function (e) {
|
||||||
var params = this.getParams()
|
var params = this.getParams()
|
||||||
|
|
||||||
|
document.getElementById('articleEditButton').focus()
|
||||||
this.transitionTo('codes', {
|
this.transitionTo('codes', {
|
||||||
userName: params.userName,
|
userName: params.userName,
|
||||||
planetName: params.planetName,
|
planetName: params.planetName,
|
||||||
@@ -27,9 +28,10 @@ module.exports = React.createClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (article.type === 'note') {
|
if (article.type === 'note') {
|
||||||
return function () {
|
return function (e) {
|
||||||
var params = this.getParams()
|
var params = this.getParams()
|
||||||
|
|
||||||
|
document.getElementById('articleEditButton').focus()
|
||||||
this.transitionTo('notes', {
|
this.transitionTo('notes', {
|
||||||
userName: params.userName,
|
userName: params.userName,
|
||||||
planetName: params.planetName,
|
planetName: params.planetName,
|
||||||
@@ -91,7 +93,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='PlanetArticleList'>
|
<div className='PlanetArticleList'>
|
||||||
<ul>
|
<ul ref='articles'>
|
||||||
{articles}
|
{articles}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -230,6 +230,18 @@ module.exports = React.createClass({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var listElement = this.refs.list.refs.articles.getDOMNode()
|
||||||
|
var articleElement = listElement.querySelectorAll('li')[index]
|
||||||
|
|
||||||
|
var overflowBelow = listElement.clientHeight + listElement.scrollTop < articleElement.offsetTop + articleElement.clientHeight
|
||||||
|
if (overflowBelow) {
|
||||||
|
listElement.scrollTop = articleElement.offsetTop + articleElement.clientHeight - listElement.clientHeight
|
||||||
|
}
|
||||||
|
var overflowAbove = listElement.scrollTop > articleElement.offsetTop
|
||||||
|
if (overflowAbove) {
|
||||||
|
listElement.scrollTop = articleElement.offsetTop
|
||||||
|
}
|
||||||
|
|
||||||
if (article.type === 'code') {
|
if (article.type === 'code') {
|
||||||
params.localId = article.localId
|
params.localId = article.localId
|
||||||
this.transitionTo('codes', params)
|
this.transitionTo('codes', params)
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ module.exports = React.createClass({
|
|||||||
return this.renderUserHome(currentUser)
|
return this.renderUserHome(currentUser)
|
||||||
}
|
}
|
||||||
} else if (this.isActive('planet') && user != null && user.userType === 'team') {
|
} else if (this.isActive('planet') && user != null && user.userType === 'team') {
|
||||||
console.log(user.Members)
|
|
||||||
var members = user.Members.map(function (member) {
|
var members = user.Members.map(function (member) {
|
||||||
return (
|
return (
|
||||||
<li key={'user-' + member.id}><Link to='userHome' params={{userName: member.name}}>
|
<li key={'user-' + member.id}><Link to='userHome' params={{userName: member.name}}>
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ articleListWidth= 275px
|
|||||||
overflow-y auto
|
overflow-y auto
|
||||||
li
|
li
|
||||||
.articleItem
|
.articleItem
|
||||||
|
noSelect()
|
||||||
border solid 2px transparent
|
border solid 2px transparent
|
||||||
position relative
|
position relative
|
||||||
height 94px
|
height 94px
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.HomeContainer
|
.HomeContainer
|
||||||
.HomeNavigator
|
.HomeNavigator
|
||||||
|
noSelect()
|
||||||
background-color planetNavBgColor
|
background-color planetNavBgColor
|
||||||
absolute left top bottom
|
absolute left top bottom
|
||||||
width 55px
|
width 55px
|
||||||
|
|||||||
@@ -341,6 +341,7 @@
|
|||||||
padding 0 15px
|
padding 0 15px
|
||||||
border-radius 5px
|
border-radius 5px
|
||||||
margin-left 5px
|
margin-left 5px
|
||||||
|
font-size 1em
|
||||||
button.sendButton
|
button.sendButton
|
||||||
btnPrimary()
|
btnPrimary()
|
||||||
.confirmation
|
.confirmation
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"description": "Boost App",
|
"description": "Boost App",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user