8f37e6ecff
This change makes the JS in for preset management more resilient. Previously, if the button was not on the page then an error was thrown. Instead this code changes the listener to listen to the document and filters the clicked element based on the same selector. This is a much safer approach as it will not error if the selector was not found on the page. In this case the behat test introduced elsewhere in this issue is testing a scenario where the Save as preset button is not present because there are no fields to store as a preset.