I have a better idea of what caused this regression. I’ll try to explain it. The war/src/main/js/config-scrollspy.js JS entry point contains some fixes for drag & drop behaviour for the job and folders form forms. Fixes are applied on a proxied Behaviour.specify call on the tabbar.js file it imports. These fixes are initialized by a function wrapped within a $() jquery block .(https://github.com/jenkinsci/jenkins/blob/23ab517cb4de3edd80e07b77d332d47eb9049276/war/src/main/js/config-scrollspy.js#L29). Before 2.217, the code would run in the following order:
- config-scrollspy.js loads and it’s executed.
- The initialization code runs immediatly and the Behaviour.specify call registers the fixes (https://github.com/jenkinsci/jenkins/blob/1ca9f6e8d649be88adb364da5dc2533706a8bfa5/war/src/main/js/widgets/config/tabbar.js#L13)
- The window.onload event handler is triggered, and runs all pieces of code set up via Behaviour.specify
On 2.217+:
- config-scrollspy.js loads and it’s script-level code is executed, but the initialization code does not run.
- The window.onload event handler is triggered, and runs all pieces of code set up via Behaviour.specify. Because the intialization code was not yet run on the config-scrollspy.js file, drag & drop widgets existing on the page are not initialized.
- The initialization code for the drag & drop fixes is run. Because it came after the _window.onload _event, it will only apply to draggable widgets added after this point (i.e. recently added and unsaved steps).
Basically, jQuery will wait until window.onload event to run the subscription code on 2.217+. The fix consists on moving the Behaviour.specify call on the tabbar.js file to be run when the script loads, so that it happens before the window.onload event. I don’t think it will negatively impact any other part of the app / plugin. |