提交 7cf9e577 编写于 作者: K kohsuke

Fixed #145.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1134 71c3de6d-444a-0410-be80-ed276b4c234a
上级 94536112
<!--
<input type="checkbox"> tag that takes true/false for @checked
-->
<input type="checkbox" name="${attrs.name}" onclick="${attrs.onclick}"
<input type="checkbox" name="${attrs.name}" onclick="${attrs.onclick}" id="${attrs.id}"
checked="${h.ifThenElse(attrs.checked,'true',null)}"/>
\ No newline at end of file
<!--
Outer-most tag that forms a form tag.
Foldable block expanded when the menu item is checked.
This needs a fix. Big time.
......@@ -13,37 +13,10 @@
<j:if test="${empty(help)}">
<j:set var="help" value="${null}" />
</j:if>
<tr id="oe_s${oe_id}"><!-- this ID marks the beginning -->
<tr id="oe_s${oe_id}" hasHelp="${help!=null}"><!-- this ID marks the beginning -->
<td colspan="3">
<script>
function toggle${oe_id}() {
var tbl = document.getElementById('oe_s${oe_id}').parentNode;
var i = false;
var o = false;
for( j=0; tbl.rows[j]; j++ ) {
n = tbl.rows[j];
if(n.id=="oe_e${oe_id}")
o = true;
if( i &amp;&amp; !o ) {
if( n.style.display!="none" )
n.style.display = "none";
else
n.style.display = "";
}
if(n.id=="oe_s${oe_id}") {
<j:if test="${help!=null}">
j++;
</j:if>
i = true;
}
}
}
</script>
<f:checkbox name="${name}" onclick="javascript:toggle${oe_id}()" checked="${checked}" />
<f:checkbox name="${name}" onclick="javascript:updateOptionalBlock('oe_s${oe_id}','oe_e${oe_id}','oe_c${oe_id}')"
id="oe_c${oe_id}" checked="${checked}" />
${title}
</td>
<j:if test="${help!=null}">
......@@ -58,10 +31,8 @@
<d:invokeBody />
<!-- end marker -->
<tr id="oe_e${oe_id}" style="display:none">
<j:if test="${checked=='false'}">
<script>
toggle${oe_id}();
</script>
</j:if>
<script>
updateOptionalBlock('oe_s${oe_id}','oe_e${oe_id}','oe_c${oe_id}');
</script>
</tr>
</j:jelly>
......@@ -150,4 +150,37 @@ function replaceDescription() {
}
);
return false;
}
\ No newline at end of file
}
// used by optionalBlock.jelly to update the form status
// @param sid ID of the start marker
// @param sid ID of the end marker
// @param cid ID of the check box
function updateOptionalBlock(sid, eid, cid) {
var tbl = document.getElementById(sid).parentNode;
var i = false;
var o = false;
var checked = document.getElementById(cid).checked;
for (var j = 0; tbl.rows[j]; j++) {
var n = tbl.rows[j];
if (n.id == eid)
o = true;
if (i && !o) {
if (checked)
n.style.display = "";
else
n.style.display = "none";
}
if (n.id == sid) {
if (n.getAttribute('hasHelp') == 'true')
j++;
i = true;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册