You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.1 KiB

  1. <template>
  2. <div class="panel panel-default scorecard" v-if="show">
  3. <div class="panel-heading">
  4. <div class="team">
  5. <span class="team-icon" :style="'background-color: #'+tweet.team_color"></span>
  6. <span class="team-name">{{ tweet.team_name }}</span>
  7. </div>
  8. <button type="button" class="close" v-on:click="dismiss"><span>&times;</span></button>
  9. </div>
  10. <div class="panel-body">
  11. <div class="row">
  12. <div class="col-md-8">
  13. <div class="profile">
  14. <img :src="tweet.player_photo" :style="'border-color: #'+tweet.team_color">
  15. <span><a :href="'https://twitter.com/'+tweet.player_username">@{{ tweet.player_username }}</a></span>
  16. </div>
  17. <div class="tweet">
  18. <div class="text">{{ tweet.text }}</div>
  19. <div v-if="tweet.photos">
  20. <template v-if="tweet.photos.length == 1">
  21. <div v-for="img in tweet.photos">
  22. <img :src="img">
  23. </div>
  24. </template>
  25. <template v-else>
  26. <div :class="'multi-photo photos-'+tweet.photos.length" v-if="tweet.photos">
  27. <div v-for="img in tweet.photos" class="photo" :style="'background-image:url('+img+')'" :data-featherlight="img">
  28. <img :src="img">
  29. </div>
  30. </div>
  31. <div class="multi-photo-clear"></div>
  32. </template>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="col-md-4">
  37. <div>{{ tweet.mission }}</div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. module.exports = {
  45. props: ['show', 'tweet'],
  46. data () {
  47. return {
  48. }
  49. },
  50. methods: {
  51. dismiss() {
  52. this.$emit('dismiss')
  53. }
  54. },
  55. watch: {
  56. // https://vuejs.org/v2/guide/computed.html#Watchers
  57. show: function(val) {
  58. if(val) {
  59. // https://vuejs.org/v2/guide/reactivity.html#Async-Update-Queue
  60. Vue.nextTick(function() {
  61. $(".multi-photo .photo").featherlight();
  62. });
  63. }
  64. }
  65. },
  66. created() {
  67. }
  68. }
  69. </script>