|
@ -31,10 +31,16 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="tweet-reply"> |
|
|
|
|
|
<textarea class="form-control" rows="2" v-model="replyText" style="margin-bottom: 4px;"></textarea> |
|
|
|
|
|
<button type="submit" class="btn btn-primary" :disabled="isTweetReplyDisabled">Reply</button> |
|
|
|
|
|
<div class="clear"></div> |
|
|
|
|
|
|
|
|
<div class="tweet-reply" v-if="showReplyBox"> |
|
|
|
|
|
<div class="top"> |
|
|
|
|
|
<textarea class="form-control" rows="2" v-model="replyText" style="margin-bottom: 4px;" :disabled="replyInProgress"></textarea> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="bottom"> |
|
|
|
|
|
<div class="fill"></div> |
|
|
|
|
|
<img src="/twitter.ico" width="16"> |
|
|
|
|
|
<div class="remaining-chars">{{ replyTextCharsRemaining }}</div> |
|
|
|
|
|
<button class="btn btn-primary" :disabled="isTweetReplyDisabled" v-on:click="sendReply">Reply</button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="tweet-actions"> |
|
|
<div class="tweet-actions"> |
|
@ -151,9 +157,6 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
@ -169,6 +172,9 @@ module.exports = { |
|
|
centers: [], |
|
|
centers: [], |
|
|
lines: [], |
|
|
lines: [], |
|
|
replyText: '', |
|
|
replyText: '', |
|
|
|
|
|
replyTextCharsRemaining: 140, |
|
|
|
|
|
replyInProgress: false, |
|
|
|
|
|
showReplyBox: true, |
|
|
selectedDocument: null, |
|
|
selectedDocument: null, |
|
|
selectedTransitCenter: null, |
|
|
selectedTransitCenter: null, |
|
|
selectedTransitLine: null, |
|
|
selectedTransitLine: null, |
|
@ -203,7 +209,7 @@ module.exports = { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
isTweetReplyDisabled() { |
|
|
isTweetReplyDisabled() { |
|
|
return this.replyText == ''; |
|
|
|
|
|
|
|
|
return this.replyText == '' || this.replyInProgress || this.replyTextCharsRemaining < 0; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
@ -216,6 +222,7 @@ module.exports = { |
|
|
this.selectedM5Singing = false; |
|
|
this.selectedM5Singing = false; |
|
|
this.selectedM5Tipping = false; |
|
|
this.selectedM5Tipping = false; |
|
|
this.replyText = ''; |
|
|
this.replyText = ''; |
|
|
|
|
|
this.showReplyBox = true; |
|
|
}, |
|
|
}, |
|
|
dismiss() { |
|
|
dismiss() { |
|
|
this.clearState(); |
|
|
this.clearState(); |
|
@ -268,6 +275,21 @@ module.exports = { |
|
|
this.clearState(); |
|
|
this.clearState(); |
|
|
this.$emit('complete'); |
|
|
this.$emit('complete'); |
|
|
}.bind(this)); |
|
|
}.bind(this)); |
|
|
|
|
|
}, |
|
|
|
|
|
sendReply() { |
|
|
|
|
|
this.replyInProgress = true; |
|
|
|
|
|
|
|
|
|
|
|
$.post("/dashboard/reply", { |
|
|
|
|
|
tweet_id: this.tweet.tweet_id, |
|
|
|
|
|
text: this.replyText |
|
|
|
|
|
}, function(response){ |
|
|
|
|
|
if(response.result == "ok") { |
|
|
|
|
|
this.replyText = ''; |
|
|
|
|
|
} |
|
|
|
|
|
this.replyInProgress = false; |
|
|
|
|
|
}.bind(this)); |
|
|
|
|
|
|
|
|
|
|
|
// setTimeout(function(){ this.replyInProgress = false; this.showReplyBox = false; }.bind(this), 1000); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@ -279,6 +301,9 @@ module.exports = { |
|
|
$(".multi-photo .photo").featherlight(); |
|
|
$(".multi-photo .photo").featherlight(); |
|
|
}.bind(this)); |
|
|
}.bind(this)); |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
replyText: function(val) { |
|
|
|
|
|
this.replyTextCharsRemaining = 140 - twitter.getTweetLength(val); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|