未验证 提交 30dd4c6e 编写于 作者: B Baptiste Mathus 提交者: GitHub

Merge pull request #4568 from fqueiruga/jenkins-61429_fix-reorder-steps-in-some-forms

[JENKINS-61429] Fix drag & drop for existing steps in job & folders forms
......@@ -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
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册