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.

74 lines
1.9 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. <div :class="'multi-photo photos-'+tweet.photos.length" v-if="tweet.photos">
  21. <div v-for="img in tweet.photos" class="photo" :style="'background-image:url('+img+')'" :data-featherlight="img">
  22. <img :src="img">
  23. </div>
  24. </div>
  25. <div class="multi-photo-clear"></div>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="col-md-4">
  30. <div>{{ tweet.mission }}</div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. module.exports = {
  38. props: ['show', 'tweet'],
  39. data () {
  40. return {
  41. }
  42. },
  43. methods: {
  44. dismiss() {
  45. this.$emit('dismiss')
  46. }
  47. },
  48. watch: {
  49. // https://vuejs.org/v2/guide/computed.html#Watchers
  50. show: function(val) {
  51. if(val) {
  52. // https://vuejs.org/v2/guide/reactivity.html#Async-Update-Queue
  53. Vue.nextTick(function() {
  54. $(".multi-photo .photo").featherlight();
  55. });
  56. }
  57. }
  58. },
  59. created() {
  60. }
  61. }
  62. </script>