Page 1 of 1

How to jump/focus on the product that has been saved

Posted: Sun May 07, 2023 3:42 pm
by tessthepup
Not sure of the correct term 'jump' or 'focus' but is it possible that when saving a product after editing that the page can jump/focus/scroll to that product?

Just trying to save a bit of time when editing products and having to keep scrolling down the page to the next product to edit.

Re: How to jump/focus on the product that has been saved

Posted: Sun May 07, 2023 6:19 pm
by ecartz

Code: Select all

class hook_admin_catalog_scroll_to_active {

  public function listen_infoBox() {
   if (empty($GLOBALS['action']) || ('default' === $GLOBALS['action'])) {
     echo <<<'EOJS'
<script>
  document.getElementsByClassName('table-active')[0].scrollIntoView();
</script>
EOJS;
    }
  }

}
would probably mostly work.

https://stackoverflow.com/a/22292000/6660678
https://stackoverflow.com/q/21436550/6660678

Re: How to jump/focus on the product that has been saved

Posted: Sun May 07, 2023 6:50 pm
by tessthepup
@ecartz

It certainly did, thank you :D