diff --git a/war/src/main/js/widgets/config/tabbar.js b/war/src/main/js/widgets/config/tabbar.js index 4a60d79e3e..182a38bf4a 100644 --- a/war/src/main/js/widgets/config/tabbar.js +++ b/war/src/main/js/widgets/config/tabbar.js @@ -5,13 +5,25 @@ import tableMetadata from './model/ConfigTableMetaData'; import behaviorShim from '../../util/behavior-shim'; import jenkinsLocalStorage from '../../util/jenkinsLocalStorage'; +/** + * Extracting this call from outside of the addPageTabs due to a regression + * in 2.216/2.217 (see JENKINS-61429) + * + * The proxied call to Behaviour.specify needs to be called from outside of the + * addPageTabs function. Otherwise, it will not apply to existing draggable + * elements on the form. It would only only apply to new elements. + * + * Extracting this Behaviour.specify call to the module level causes it to be executed + * on script load, and this seems to set up the event listeners properly. + */ +behaviorShim.specify(".dd-handle", 'config-drag-start', 1000, function(el) { + page.fixDragEvent(el); +}); + export var tabBarShowPreferenceKey = 'config:usetabs'; export var addPageTabs = function(configSelector, onEachConfigTable, options) { $(function() { - behaviorShim.specify(".dd-handle", 'config-drag-start', 1000, function(el) { - page.fixDragEvent(el); - }); // We need to wait until after radioBlock.js Behaviour.js rules // have been applied, otherwise row-set rows become visible across sections. @@ -147,4 +159,4 @@ export var addFinderToggle = function(configTableMetadata) { if (jenkinsLocalStorage.getGlobalItem(finderShowPreferenceKey, "yes") === 'yes') { findToggle.click(); } -}; \ No newline at end of file +};