This commit is contained in:
syuilo
2017-02-20 14:33:30 +09:00
parent 3211d90e09
commit 12cba7a76d
37 changed files with 173 additions and 167 deletions

View File

@@ -58,7 +58,7 @@
this.wait = false
this.on('mount', () => {
@user-promise.then (user) =>
this.user-promise.then (user) =>
this.user = user
this.init = false
this.update();
@@ -70,22 +70,22 @@
this.stream.off 'unfollow' this.on-stream-unfollow
this.on-stream-follow = (user) => {
if user.id == @user.id
if user.id == this.user.id
this.user = user
this.update();
this.on-stream-unfollow = (user) => {
if user.id == @user.id
if user.id == this.user.id
this.user = user
this.update();
this.onclick = () => {
this.wait = true
if @user.is_following
if this.user.is_following
this.api 'following/delete' do
user_id: @user.id
user_id: this.user.id
.then =>
@user.is_following = false
this.user.is_following = false
.catch (err) ->
console.error err
.then =>
@@ -93,9 +93,9 @@
this.update();
else
this.api 'following/create' do
user_id: @user.id
user_id: this.user.id
.then =>
@user.is_following = true
this.user.is_following = true
.catch (err) ->
console.error err
.then =>

View File

@@ -17,17 +17,17 @@
</style>
<script>
this.on('mount', () => {
Velocity this.root, {
Velocity(this.root, {
bottom: '0px'
} {
}, {
duration: 500ms
easing: 'ease-out'
}
setTimeout =>
Velocity this.root, {
Velocity(this.root, {
bottom: '-64px'
} {
}, {
duration: 500ms
easing: 'ease-out'
complete: =>

View File

@@ -30,24 +30,24 @@
this.mixin('stream');
this.on('before-mount', () => {
this.state = @get-stream-state!
this.state = this.getStreamState();
if @state == 'connected'
if this.state == 'connected'
this.root.style.opacity = 0
this.stream-state-ev.on('connected', () => {
this.state = @get-stream-state!
this.state = this.getStreamState();
this.update();
setTimeout =>
Velocity this.root, {
Velocity(this.root, {
opacity: 0
} 200ms 'linear'
, 1000ms
this.stream-state-ev.on('closed', () => {
this.state = @get-stream-state!
this.state = this.getStreamState();
this.update();
Velocity this.root, {
Velocity(this.root, {
opacity: 1
} 0ms
</script>

View File

@@ -12,7 +12,7 @@
this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/followers' do
user_id: @user.id
user_id: this.user.id
iknow: iknow
limit: limit
cursor: if cursor? then cursor else undefined

View File

@@ -12,7 +12,7 @@
this.fetch = (iknow, limit, cursor, cb) => {
this.api 'users/following' do
user_id: @user.id
user_id: this.user.id
iknow: iknow
limit: limit
cursor: if cursor? then cursor else undefined

View File

@@ -16,7 +16,7 @@
this.init = new Promise (res, rej) =>
this.api 'users/posts' do
user_id: @user.id
user_id: this.user.id
with_media: @with-media
.then (posts) =>
res posts
@@ -24,7 +24,7 @@
this.more = () => {
this.api 'users/posts' do
user_id: @user.id
user_id: this.user.id
with_media: @with-media
max_id: this.refs.timeline.tail!.id
</script>

View File

@@ -165,7 +165,7 @@
this.on('mount', () => {
this.api 'users/show' do
username: @username
username: this.username
.then (user) =>
this.fetching = false
this.user = user

View File

@@ -102,7 +102,7 @@
this.mode == 'iknow'
@limit
@cursor
this.users = @users.concat obj.users
this.users = this.users.concat obj.users
this.next = obj.next
this.more-fetching = false
this.update();