-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COMPATIBILITY: Modernize the component #11
Changes from all commits
2b083da
62649eb
53c8043
4b5cd92
7df5cf4
6942e44
9ea30ce
8d68d38
6f707b4
d615866
0b8084c
30943e2
709e888
6c5f54a
78394f2
0a8d0fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
< 3.3.0.beta1-dev: f3561ce7fd9dded965fb8e9a99229539c7af3aa1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/eslint-theme"); |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/prettier"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("@discourse/lint-configs/template-lint"); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { apiInitializer } from "discourse/lib/api"; | ||
import CustomHeaderLinks from "../components/custom-header-links"; | ||
|
||
export default apiInitializer("1.29.0", (api) => { | ||
if (!settings.header_links) { | ||
return; | ||
} | ||
|
||
if (settings.links_position === "right") { | ||
api.headerButtons.add("dropdown-header", CustomHeaderLinks, { | ||
before: "auth", | ||
}); | ||
} else { | ||
api.renderAfterWrapperOutlet("home-logo", CustomHeaderLinks); | ||
} | ||
}); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Component from "@ember/component"; | ||
import { fn } from "@ember/helper"; | ||
import { on } from "@ember/modifier"; | ||
import { action } from "@ember/object"; | ||
import { service } from "@ember/service"; | ||
import DiscourseURL from "discourse/lib/url"; | ||
import CustomIcon from "./custom-icon"; | ||
|
||
export default class CustomHeaderDropdown extends Component { | ||
@service site; | ||
@service router; | ||
|
||
@action | ||
redirectToUrl(url, event) { | ||
if (this.site.mobileView) { | ||
this.toggleHeaderLinks(); | ||
} | ||
|
||
DiscourseURL.routeTo(url); | ||
|
||
event.stopPropagation(); | ||
} | ||
|
||
<template> | ||
<li | ||
class="custom-header-dropdown-link" | ||
title={{@item.title}} | ||
role="button" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes the "Interaction added to non-interactive element" error. Ideally, I think we want to use |
||
{{on "click" (fn this.redirectToUrl @item.url)}} | ||
> | ||
<CustomIcon @icon={{@item.icon}} /> | ||
<span class="custom-header-link-title">{{@item.title}}</span> | ||
{{#if @item.description}} | ||
<span class="custom-header-link-desc">{{@item.description}}</span> | ||
{{/if}} | ||
</li> | ||
</template> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin outlet wrapper is not inside
.title
.