From be999c964ddca690280a0d82cbafb47b127872f5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 13 May 2019 21:15:00 -0600 Subject: [PATCH] Update Timeline.vue --- resources/assets/js/components/Timeline.vue | 36 +++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index cdc1087f5..61e42f9ad 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -274,7 +274,7 @@
-
+
Suggestions
@@ -1067,7 +1067,6 @@ if(this.config.ab.rec == false) { return; } - axios.get('/api/local/exp/rec') .then(res => { this.suggestions = res.data; @@ -1123,6 +1122,39 @@ $('textarea[name="comment"]').focus(); } }, + + refreshSuggestions() { + let el = event.target.parentNode; + if(el.classList.contains('disabled') == true) { + return; + } + axios.get('/api/local/exp/rec', { + params: { + refresh: true + } + }) + .then(res => { + this.suggestions = res.data; + + if (el.classList) { + el.classList.add('disabled'); + el.classList.add('text-light'); + } + else { + el.className += ' ' + 'disabled text-light'; + } + setTimeout(function() { + el.setAttribute('href', '#'); + if (el.classList) { + el.classList.remove('disabled'); + el.classList.remove('text-light'); + } + else { + el.className = el.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), 'disabled text-light'); + } + }, 10000); + }); + } } }