diff options
Diffstat (limited to 'public/assets/js/lib/views/stream')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootfilters.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/stream/hootfilters.js b/public/assets/js/lib/views/stream/hootfilters.js index 2f4e4ac..68f0cdd 100644 --- a/public/assets/js/lib/views/stream/hootfilters.js +++ b/public/assets/js/lib/views/stream/hootfilters.js @@ -15,6 +15,7 @@ var HootFilters = View.extend({ this.$hoots = this.$("[name=hoots]"); this.$sortOrder = this.$(".sort"); this.$sort = this.$("[name=sort]"); + this.$editLink = this.$(".editLink"); this.$classicLink = this.$(".classicLink"); this.state = { unset: true, @@ -65,17 +66,27 @@ var HootFilters = View.extend({ this.$hoots.closest("label").toggle(hoots); this.$files.closest("label").toggle(normal_files); if (target.thread || target.keyword || target.username) { - let classicHref, classicText; + let classicHref, classicText, editText, editHref; if (target.thread) { + editHref = `/details/${target.thread}/settings`; classicHref = `/details/${target.thread}`; + editText = "settings"; classicText = "thread"; } else if (target.keyword) { + editHref = `/post/${target.keyword}`; classicHref = `/index/${target.keyword}`; + editText = "post"; classicText = "keyword"; } else if (target.username) { classicHref = `/profile/${target.username}`; classicText = "profile"; } + if (editHref) { + this.$editLink.show(); + this.$editLink.find("a").attr("href", editHref).html(editText); + } else { + this.$editLink.hide(); + } this.$classicLink.show(); this.$classicLink.find("a").attr("href", classicHref).html(classicText); } else { |
