|
|
@ -31,10 +31,16 @@ |
|
|
|
</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 class="tweet-actions"> |
|
|
@ -151,9 +157,6 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
@ -169,6 +172,9 @@ module.exports = { |
|
|
|
centers: [], |
|
|
|
lines: [], |
|
|
|
replyText: '', |
|
|
|
replyTextCharsRemaining: 140, |
|
|
|
replyInProgress: false, |
|
|
|
showReplyBox: true, |
|
|
|
selectedDocument: null, |
|
|
|
selectedTransitCenter: null, |
|
|
|
selectedTransitLine: null, |
|
|
@ -203,7 +209,7 @@ module.exports = { |
|
|
|
} |
|
|
|
}, |
|
|
|
isTweetReplyDisabled() { |
|
|
|
return this.replyText == ''; |
|
|
|
return this.replyText == '' || this.replyInProgress || this.replyTextCharsRemaining < 0; |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -216,6 +222,7 @@ module.exports = { |
|
|
|
this.selectedM5Singing = false; |
|
|
|
this.selectedM5Tipping = false; |
|
|
|
this.replyText = ''; |
|
|
|
this.showReplyBox = true; |
|
|
|
}, |
|
|
|
dismiss() { |
|
|
|
this.clearState(); |
|
|
@ -268,6 +275,21 @@ module.exports = { |
|
|
|
this.clearState(); |
|
|
|
this.$emit('complete'); |
|
|
|
}.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: { |
|
|
@ -279,6 +301,9 @@ module.exports = { |
|
|
|
$(".multi-photo .photo").featherlight(); |
|
|
|
}.bind(this)); |
|
|
|
} |
|
|
|
}, |
|
|
|
replyText: function(val) { |
|
|
|
this.replyTextCharsRemaining = 140 - twitter.getTweetLength(val); |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|