Stops the agent view from autoscrolling down to the last message in the thread. Allows you to disable it without modifying core code.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
class.PreventAutoscroll.php
config.php
plugin.php

README.md

osTicket plugin: Prevent Autoscroll

Stops agent ticket views from auto-scrolling to the last thread-entry.

Possibly overkill, but by making a plugin I am stopping myself from editing core.

Requirements: Install the AttachmentPreview plugin: https://github.com/clonemeagain/attachment_preview

That plugin exposes an API that lets other plugins edit the output of osTicket before it reaches the browser, this plugin needs that API.

How to enable

  • Download and unzip this plugin into your /include/plugins folder v1.0 zip v1.0 gzip
  • Use an admin account to visit /scp/plugins.php (Admin Panel => Manage => Plugins)
  • Select "Add new Plugin"
  • Press "Install" next to "Prevent Autoscroll"
  • Click the checkbox next to "Prevent Autoscroll"
  • From the "More dropdown" select "Enable"

Now test by visiting a ticket, due to pjax, you might need to refresh the page. The only change should be that the viewport no longer scrolls to the last thread entry. All other functionality should still work, let me know if it doesn't.

This plugin is not actually required

If you want this functionality without installing a plugin, simply edit /scp/js/thread.js

var thread = {

    options: {
        autoScroll: true,
        showimages: false
    },

    scrollTo: function (entry) {

       if (!entry) return;

       var frame = 0;
... snip ...

Modify it to:

var thread = {

    options: {
        autoScroll: true,
        showimages: false
    },

    scrollTo: function (entry) {
    
    	   return; // Prevent Autoscroll MOD

       if (!entry) return;

... snip ...