提交 d1ff7508 编写于 作者: K kohsuke

adding a button to remove a row.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6415 71c3de6d-444a-0410-be80-ed276b4c234a
上级 6b662bd3
......@@ -13,10 +13,17 @@
'-' is not a part of Java identifier, so this transformation
doesn't cause ambuguity.
-->
<f:checkbox name="${p.id.replace('.','-')}" checked="${instance.hasPermission(sid,p)}"/>
<f:checkbox name="${p.id.replace('.','-')}" checked="${instance.hasPermission(attrs.sid,p)}"/>
</td>
</j:forEach>
</j:forEach>
<td class="stop">
<j:if test="${attrs.sid!='anonymous'}">
<a href="#">
<img alt="remove" src="${imagesURL}/16x16/stop.gif"/>
</a>
</j:if>
</td>
</d:tag>
</d:taglib>
<link rel="stylesheet" href="${h.getViewResource(descriptor,'table.css')}" type="text/css" />
......@@ -32,6 +39,7 @@
${g.owner.name}
</th>
</j:forEach>
<td rowspan="2" class="stop" />
</tr>
<!-- The second row for individual permission -->
<tr class="caption-row">
......@@ -46,7 +54,7 @@
<j:forEach var="sid" items="${instance.allSIDs}">
<tr name="${sid}">
<local:row title="${sid}"/>
<local:row title="${sid}" sid="${sid}"/>
</tr>
</j:forEach>
<tr name="anonymous">
......@@ -69,7 +77,8 @@
(function() {
<!-- place master outside the DOM tree so that it won't creep into the submitted form -->
var master = document.getElementById('${id}');
master.parentNode.removeChild(master);
var table = master.parentNode;
table.removeChild(master);
makeButton("${id}button", function (e) {
var copy = document.importNode(master,true);
......@@ -78,9 +87,21 @@
var name = $$('${id}text').value;
copy.firstChild.innerHTML = name;
copy.setAttribute("name",name);
master.parentNode.appendChild(copy);
table.appendChild(copy);
Behaviour.applySubtree(findAncestor(table,"TABLE"));
});
})();
Behaviour.register({
"#global-matrix-authorization-strategy-table TD.stop A" : function(e) {
e.onclick = function() {
var tr = findAncestor(this,"TR");
tr.parentNode.removeChild(tr);
return false;
}
e = null; <!-- avoid memory leak -->
}
});
</script>
</f:block>
</j:jelly>
\ No newline at end of file
......@@ -36,3 +36,8 @@
border-left: none;
}
#global-matrix-authorization-strategy-table TD.stop {
border-top: 1px solid white;
border-right: 1px solid white;
border-bottom: 1px solid white;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册