diff --git a/public/js/app.js b/public/js/app.js index e5a832d..3bfdcf8 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -46550,29 +46550,23 @@ module.exports = { removeTweetFromQueue: function removeTweetFromQueue(tweet_id) { var queueIndex = this.findTweetInQueue(tweet_id); if (queueIndex !== false) { - console.log("Removing item at index " + queueIndex); var removed = this.queue.splice(queueIndex, 1); return removed[0]; } }, - clickedTweet: function clickedTweet(event) { - var tweet_id; - if ($(event.target).data('tweet-id')) { - tweet_id = $(event.target).data('tweet-id'); - } else { - tweet_id = $(event.target).parents(".tweet").data('tweet-id'); - } - - var tweet_data = this.removeTweetFromQueue(tweet_id); + clickedTweet: function clickedTweet(tweet_index) { + // var tweet_data = this.removeTweetFromQueue(tweet_id); + var tweet_data = this.queue[tweet_index]; + var tweet_id = tweet_data.tweet_id; if (tweet_data) { - console.log(tweet_data); - // Mark this as claimed $.post('/dashboard/claim-tweet', { tweet_id: tweet_id }, function (response) {}); + this.removeTweetFromQueue(tweet_id); + // Load in the scorecard viewer this.tweet = tweet_data; this.show = true; @@ -46581,7 +46575,7 @@ module.exports = { } }, dismissTweet: function dismissTweet() { - console.log('caught event'); + this.queue.push(this.tweet); // Mark as un-claimed $.post('/dashboard/claim-tweet', { @@ -46615,20 +46609,16 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c staticClass: "panel-heading" }, [_vm._v("Queue")]), _vm._v(" "), _c('div', { staticClass: "panel-body tweet-queue" - }, _vm._l((_vm.queue), function(tweet) { + }, _vm._l((_vm.queue), function(tweet, index) { return _c('div', { staticClass: "tweet", - attrs: { - "data-tweet-id": tweet.tweet_id - }, on: { - "click": _vm.clickedTweet + "click": function($event) { + _vm.clickedTweet(index) + } } }, [_c('div', { - staticClass: "mission", - attrs: { - "data-mission-id": tweet.mission_id - } + staticClass: "mission" }, [_vm._v(_vm._s(tweet.mission))]), _vm._v(" "), _c('div', { staticClass: "profile" }, [_c('img', { @@ -46707,13 +46697,7 @@ module.exports = Component.exports /***/ (function(module, exports, __webpack_require__) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; - return _c('div', { - directives: [{ - name: "show", - rawName: "v-show", - value: (_vm.show), - expression: "show" - }], + return (_vm.show) ? _c('div', { staticClass: "panel panel-default scorecard" }, [_c('div', { staticClass: "panel-heading" @@ -46777,7 +46761,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c staticClass: "multi-photo-clear" })]], 2) : _vm._e()])]), _vm._v(" "), _c('div', { staticClass: "col-md-4" - }, [_c('div', [_vm._v(_vm._s(_vm.tweet.mission))])])])])]) + }, [_c('div', [_vm._v(_vm._s(_vm.tweet.mission))])])])])]) : _vm._e() },staticRenderFns: []} module.exports.render._withStripped = true if (false) { @@ -46791,6 +46775,8 @@ if (false) { /* 61 */ /***/ (function(module, exports) { +// +// // // // diff --git a/resources/assets/js/components/Scorecard.vue b/resources/assets/js/components/Scorecard.vue index 247dbc0..c166253 100644 --- a/resources/assets/js/components/Scorecard.vue +++ b/resources/assets/js/components/Scorecard.vue @@ -1,5 +1,5 @@