Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: Add topic-navigation plugin outlet and popup component (#15081)

Bianca Nenciu0335c9d77f28
diff --git a/app/assets/javascripts/discourse/app/components/topic-navigation-popup.js b/app/assets/javascripts/discourse/app/components/topic-navigation-popup.js
new file mode 100644
index 00000000000..2b104b6506c
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/components/topic-navigation-popup.js
@@ -0,0 +1,12 @@
+import Component from "@ember/component";
+import { action } from "@ember/object";
+
+export default Component.extend({
+ tagName: "",
+ hidden: false,
+
+ @action
+ close() {
+ this.set("hidden", true);
+ },
+});
diff --git a/app/assets/javascripts/discourse/app/templates/components/topic-navigation-popup.hbs b/app/assets/javascripts/discourse/app/templates/components/topic-navigation-popup.hbs
new file mode 100644
index 00000000000..66c5f3e2115
--- /dev/null
+++ b/app/assets/javascripts/discourse/app/templates/components/topic-navigation-popup.hbs
@@ -0,0 +1,6 @@
+{{#unless hidden}}
+ <div class="topic-navigation-popup">
+ {{d-button action=(action "close") class="close btn-flat" icon="times"}}
+ {{yield}}
+ </div>
+{{/unless}}
diff --git a/app/assets/javascripts/discourse/app/templates/topic.hbs b/app/assets/javascripts/discourse/app/templates/topic.hbs
index 96975d797be..cf7de91bee7 100644
--- a/app/assets/javascripts/discourse/app/templates/topic.hbs
+++ b/app/assets/javascripts/discourse/app/templates/topic.hbs
@@ -133,6 +133,8 @@
{{plugin-outlet name="above-timeline" tagName=""}}
{{#topic-navigation class="topic-navigation" topic=model jumpToDate=(action "jumpToDate") jumpToIndex=(action "jumpToIndex") as |info|}}
+ {{plugin-outlet name="topic-navigation" tagName="" args=(hash topic=model)}}
+
{{#if info.renderTimeline}}
{{topic-timeline
topic=model
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss
index 58e47fcbb80..cda3f60f8e9 100644
--- a/app/assets/stylesheets/common/base/topic.scss
+++ b/app/assets/stylesheets/common/base/topic.scss
@@ -56,6 +56,28 @@ $topic-progress-height: 42px;
z-index: z("fullscreen");
}
}
+
+ .topic-navigation-popup {
+ box-sizing: border-box;
+ position: absolute;
+ top: 0;
+ overflow-y: auto;
+ z-index: z("timeline");
+ padding: 10px 10px 35px 10px;
+ box-shadow: shadow("dropdown");
+ background: var(--tertiary-low);
+
+ .close {
+ display: flex;
+ align-items: center;
+ position: absolute;
+ right: 10px;
+ top: 10px;
+ color: var(--primary);
+ opacity: 0.5;
+ font-size: var(--font-up-1);
+ }
+ }
}
// progress bar
@media screen and (max-width: 924px) {