FIX: remove anchors from banner headings.

Else it will create UX issues when the banner is visible on top of the banner topic.
This commit is contained in:
Vinoth Kannan 2020-02-19 02:55:04 +05:30
parent 53054b41d2
commit 7a054fc142
2 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,14 @@ import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
export default Component.extend({
@discourseComputed("banner.html")
content(bannerHtml) {
const $div = $("<div>");
$div.append(bannerHtml);
$div.find("[id^='heading--']").removeAttr("id");
return $div.html();
},
@discourseComputed("user.dismissed_banner_key", "banner.key", "hide")
visible(dismissedBannerKey, bannerKey, hide) {
dismissedBannerKey =

View File

@ -3,7 +3,7 @@
<div id="banner" class={{overlay}}>
{{d-button icon="times" action="dismiss" class="btn btn-flat close" title="banner.close"}}
<div id="banner-content">
{{{banner.html}}}
{{{content}}}
{{#if currentUser.staff}}
<p><a href="{{banner.url}}">{{{i18n "banner.edit"}}}</a></p>
{{/if}}