提交 cb36d266 编写于 作者: K kohsuke

fixed a bug where the <repeatable> tag cannot be nested.

JavaScript to handle this logic is cleaned up to use behavior.js


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3425 71c3de6d-444a-0410-be80-ed276b4c234a
上级 86259627
......@@ -53,9 +53,9 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:set var="id" value="${h.generateId()}"/>
<div class="repeated-container" id="block${id}-container">
<!-- this is the master copy -->
<div id="block${id}-master" class="repeated-chunk" style="display:none">
<div class="repeated-container">
<!-- The first DIV is the master copy. -->
<div class="repeated-chunk" style="display:none">
<d:invokeBody />
</div>
<!-- then populate them for each item -->
......@@ -75,15 +75,9 @@
</j:forEach>
</j:if>
<div id="block${id}-insertion-point" />
<div class="repeatable-insertion-point" />
<j:if test="${!attrs.noAddButton}">
<input type="button" value="Add" class="repeatable-add" />
</j:if>
</div>
<script>
object(repetableSupport).init(
'block${id}-container',
'block${id}-master',
'block${id}-insertion-point');
</script>
</j:jelly>
\ No newline at end of file
......@@ -184,6 +184,15 @@ var hudsonRules = {
e.onclick = function() {
repetableSupport.onDelete(this);
};
},
"DIV.repeated-container" : function(e) {
// compute the insertion point
var ip = e.lastChild;
while(!Element.hasClassName(ip,"repeatable-insertion-point"))
ip = ip.previousSibling;
// set up the logic
object(repetableSupport).init( e, e.firstChild, ip);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册