mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 11:52:56 +08:00
FIX: Read FAQ wasn't working with a URL on the same site
This commit is contained in:
parent
11939fa8b9
commit
86c970bac0
|
@ -4,7 +4,7 @@ import DiscourseURL from 'discourse/lib/url';
|
||||||
import { ajax } from 'discourse/lib/ajax';
|
import { ajax } from 'discourse/lib/ajax';
|
||||||
|
|
||||||
createWidget('priority-faq-link', {
|
createWidget('priority-faq-link', {
|
||||||
tagName: 'a.faq-priority',
|
tagName: 'a.faq-priority.widget-link',
|
||||||
|
|
||||||
buildAttributes(attrs) {
|
buildAttributes(attrs) {
|
||||||
return { href: attrs.href };
|
return { href: attrs.href };
|
||||||
|
@ -15,12 +15,14 @@ createWidget('priority-faq-link', {
|
||||||
},
|
},
|
||||||
|
|
||||||
click(e) {
|
click(e) {
|
||||||
if (this.siteSettings.faq_url === this.attrs.href) {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (this.siteSettings.faq_url === this.attrs.href) {
|
||||||
ajax("/users/read-faq", { method: "POST" }).then(() => {
|
ajax("/users/read-faq", { method: "POST" }).then(() => {
|
||||||
this.currentUser.set('read_faq', true);
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user