From 86c970bac0b251292b826107efde2c5d403b457a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 12 Aug 2016 13:47:19 -0400 Subject: [PATCH] FIX: Read FAQ wasn't working with a URL on the same site --- .../javascripts/discourse/widgets/hamburger-menu.js.es6 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 index 099e51d8e90..933b31fc1bd 100644 --- a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 @@ -4,7 +4,7 @@ import DiscourseURL from 'discourse/lib/url'; import { ajax } from 'discourse/lib/ajax'; createWidget('priority-faq-link', { - tagName: 'a.faq-priority', + tagName: 'a.faq-priority.widget-link', buildAttributes(attrs) { return { href: attrs.href }; @@ -15,12 +15,14 @@ createWidget('priority-faq-link', { }, click(e) { + e.preventDefault(); if (this.siteSettings.faq_url === this.attrs.href) { - e.preventDefault(); ajax("/users/read-faq", { method: "POST" }).then(() => { this.currentUser.set('read_faq', true); - return DiscourseURL.routeToTag($(e.target).closest('a')[0]); + DiscourseURL.routeToTag($(e.target).closest('a')[0]); }); + } else { + DiscourseURL.routeToTag($(e.target).closest('a')[0]); } } });