A platform for community discussion. Free, open, simple.
DEV: Drop ScrollTracker component (#28911)
David Taylore7e9c99568cd
diff --git a/app/assets/javascripts/discourse/app/components/scroll-tracker.js b/app/assets/javascripts/discourse/app/components/scroll-tracker.jsdeleted file mode 100644index 317f61b0864..00000000000--- a/app/assets/javascripts/discourse/app/components/scroll-tracker.js+++ /dev/null@@ -1,40 +0,0 @@-import Component from "@ember/component";-import { next } from "@ember/runloop";-import $ from "jquery";-import Scrolling from "discourse/mixins/scrolling";--export default class ScrollTracker extends Component.extend(Scrolling) {- didReceiveAttrs() {- super.didReceiveAttrs(...arguments);-- this.set("trackerName", `scroll-tracker-${this.name}`);- }-- didInsertElement() {- super.didInsertElement(...arguments);-- this.bindScrolling();- }-- didRender() {- super.didRender(...arguments);-- const data = this.session.get(this.trackerName);- if (data && data.position >= 0 && data.tag === this.tag) {- next(() => $(window).scrollTop(data.position + 1));- }- }-- willDestroyElement() {- super.willDestroyElement(...arguments);-- this.unbindScrolling();- }-- scrolled() {- this.session.set(this.trackerName, {- position: $(window).scrollTop(),- tag: this.tag,- });- }-}diff --git a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs b/app/assets/javascripts/discourse/app/templates/full-page-search.hbsindex 23df58a75f3..1d535097693 100644--- a/app/assets/javascripts/discourse/app/templates/full-page-search.hbs+++ b/app/assets/javascripts/discourse/app/templates/full-page-search.hbs@@ -5,12 +5,6 @@{{body-class "search-page"}}<section class="search-container">- <ScrollTracker- @name="full-page-search"- @tag={{this.searchTerm}}- class="hidden"- />-<div class="search-header" role="search"><h1 class="search-page-heading">{{#if this.hasResults}}diff --git a/plugins/automation/admin/assets/javascripts/admin/templates/admin-plugins-discourse-automation-edit.hbs b/plugins/automation/admin/assets/javascripts/admin/templates/admin-plugins-discourse-automation-edit.hbsindex 74e6fb58877..9036e062855 100644--- a/plugins/automation/admin/assets/javascripts/admin/templates/admin-plugins-discourse-automation-edit.hbs+++ b/plugins/automation/admin/assets/javascripts/admin/templates/admin-plugins-discourse-automation-edit.hbs@@ -1,5 +1,3 @@-<ScrollTracker @name="discourse-automation-edit" />-<section class="discourse-automation-form edit"><form class="form-horizontal"><FormError @error={{this.error}} />