diff --git a/core/src/main/resources/lib/form/hetero-list.jelly b/core/src/main/resources/lib/form/hetero-list.jelly index 05f0a7ec8b..198ff6e733 100644 --- a/core/src/main/resources/lib/form/hetero-list.jelly +++ b/core/src/main/resources/lib/form/hetero-list.jelly @@ -58,6 +58,10 @@ THE SOFTWARE. Menu alignment against the button. Defaults to tl-bl + + If true, insert new addition by default to their 'desired' location, which + is the order induced by the descriptors. + @@ -96,7 +100,7 @@ THE SOFTWARE. -
+
diff --git a/core/src/main/resources/lib/hudson/project/config-publishers.jelly b/core/src/main/resources/lib/hudson/project/config-publishers.jelly index 71905f083a..ad29a3c429 100644 --- a/core/src/main/resources/lib/hudson/project/config-publishers.jelly +++ b/core/src/main/resources/lib/hudson/project/config-publishers.jelly @@ -34,6 +34,7 @@ THE SOFTWARE. items="${it.publishersList}" oneEach="true" menuAlign="bl-tl" + honorOrder="true" addCaption="${%Add post-build action}"/> diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index 6fb4431f16..2c8dc4b0b6 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -556,7 +556,53 @@ var jenkinsRules = { var scroll = document.body.scrollTop; renderOnDemand(findElementsBySelector(nc,"TR.config-page")[0],function() { - insertionPoint.insert({after:nc}); + function findInsertionPoint() { + // given the element to be inserted 'prospect', + // and the array of existing items 'current', + // and preferred ordering function, return the position in the array + // the prospect should be inserted. + // (for example 0 if it should be the first item) + function findBestPosition(prospect,current,order) { + function desirability(pos) { + var count=0; + for (var i=0; i