From 0c25d5df513b78d3d73492c25559dd2c28c04cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Queiruga?= Date: Thu, 12 Mar 2020 11:32:24 +0100 Subject: [PATCH 1/2] Extracts call to Behaviour.specify so that it will be applied to elements in page at load time --- war/src/main/js/widgets/config/tabbar.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/war/src/main/js/widgets/config/tabbar.js b/war/src/main/js/widgets/config/tabbar.js index 4a60d79e3e..090df9513e 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 + * + * 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. From 7f19c4de5bfa9df58c54a4c04081800f516a8482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Queiruga?= Date: Thu, 12 Mar 2020 12:08:24 +0100 Subject: [PATCH 2/2] Update war/src/main/js/widgets/config/tabbar.js Co-Authored-By: Oleg Nenashev --- war/src/main/js/widgets/config/tabbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/war/src/main/js/widgets/config/tabbar.js b/war/src/main/js/widgets/config/tabbar.js index 090df9513e..182a38bf4a 100644 --- a/war/src/main/js/widgets/config/tabbar.js +++ b/war/src/main/js/widgets/config/tabbar.js @@ -7,7 +7,7 @@ import jenkinsLocalStorage from '../../util/jenkinsLocalStorage'; /** * Extracting this call from outside of the addPageTabs due to a regression - * in 2.216/2.217 + * 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 @@ -159,4 +159,4 @@ export var addFinderToggle = function(configTableMetadata) { if (jenkinsLocalStorage.getGlobalItem(finderShowPreferenceKey, "yes") === 'yes') { findToggle.click(); } -}; \ No newline at end of file +};