DEV: Remove obsolete topic-progress code

This commit is contained in:
Jarek Radosz
2022-01-05 21:11:32 +01:00
committed by Alan Guo Xiang Tan
parent 85e124bae1
commit 5b6acea56e
2 changed files with 5 additions and 45 deletions

View File

@@ -1,8 +1,8 @@
import discourseComputed, { bind } from "discourse-common/utils/decorators";
import Component from "@ember/component";
import I18n from "I18n";
import { alias } from "@ember/object/computed";
import { later, scheduleOnce } from "@ember/runloop";
import { action } from "@ember/object";
export default Component.extend({
elementId: "topic-progress-wrapper",
@@ -13,23 +13,6 @@ export default Component.extend({
postStream: alias("topic.postStream"),
_streamPercentage: null,
@discourseComputed("progressPosition")
jumpTopDisabled(progressPosition) {
return progressPosition <= 3;
},
@discourseComputed(
"postStream.filteredPostsCount",
"topic.highest_post_number",
"progressPosition"
)
jumpBottomDisabled(filteredPostsCount, highestPostNumber, progressPosition) {
return (
progressPosition >= filteredPostsCount ||
progressPosition >= highestPostNumber
);
},
@discourseComputed(
"postStream.loaded",
"topic.currentPost",
@@ -47,17 +30,6 @@ export default Component.extend({
);
},
@discourseComputed("hugeNumberOfPosts", "topic.highest_post_number")
jumpToBottomTitle(hugeNumberOfPosts, highestPostNumber) {
if (hugeNumberOfPosts) {
return I18n.t("topic.progress.jump_bottom_with_number", {
post_number: highestPostNumber,
});
} else {
return I18n.t("topic.progress.jump_bottom");
}
},
@discourseComputed("progressPosition", "topic.last_read_post_id")
showBackButton(position, lastReadId) {
if (!lastReadId) {
@@ -195,17 +167,12 @@ export default Component.extend({
click(e) {
if (e.target.closest("#topic-progress")) {
this.send("toggleExpansion");
this.toggleProperty("expanded");
}
},
actions: {
toggleExpansion() {
this.toggleProperty("expanded");
},
goBack() {
this.attrs.jumpToPost(this.get("topic.last_read_post_number"));
},
@action
goBack() {
this.attrs.jumpToPost(this.get("topic.last_read_post_number"));
},
});

View File

@@ -2745,20 +2745,13 @@ en:
progress:
title: topic progress
go_top: "top"
go_bottom: "bottom"
go: "go"
jump_bottom: "jump to last post"
jump_prompt: "jump to..."
jump_prompt_of:
one: "of %{count} post"
other: "of %{count} posts"
jump_prompt_long: "Jump to..."
jump_bottom_with_number: "jump to post %{post_number}"
jump_prompt_to_date: "to date"
jump_prompt_or: "or"
total: total posts
current: current post
notifications:
title: change how often you get notified about this topic