提交 0427b144 编写于 作者: K Kohsuke Kawaguchi

refactored

上级 7db5fb34
......@@ -23,7 +23,7 @@ THE SOFTWARE.
-->
<!-- Tomcat doesn't like us using the attribute called 'class' -->
<?jelly escape-by-default='true'?>
<?jelly escape-by-default='true'?>
<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">
<st:documentation>
Editable drop-down combo box that supports the data binding and AJAX updates.
......@@ -43,6 +43,7 @@ THE SOFTWARE.
<script type="text/javascript" src="${request.contextPath}/scripts/utilities.js"/>
<script type="text/javascript" src="${request.contextPath}/scripts/combobox.js"/>
</st:once>
<st:adjunct includes="lib.form.combobox.combobox"/>
<f:prepareDatabinding/>
${descriptor.calcFillSettings(field,attrs)} <!-- this figures out the 'fillUrl' and 'fillDependsOn' attribute -->
......
Behaviour.register({
"INPUT.combobox2" : function(e) {
var items = [];
var c = new ComboBox(e,function(value) {
var candidates = [];
for (var i=0; i<items.length; i++) {
if (items[i].indexOf(value)==0) {
candidates.push(items[i]);
if (candidates.length>20) break;
}
}
return candidates;
}, {});
refillOnChange(e,function(params) {
new Ajax.Request(e.getAttribute("fillUrl"),{
parameters: params,
onSuccess : function(rsp) {
items = eval('('+rsp.responseText+')');
}
});
});
}
});
\ No newline at end of file
......@@ -1070,31 +1070,6 @@ var jenkinsRules = {
updateDropDownList();
},
// combobox.jelly
"INPUT.combobox2" : function(e) {
var items = [];
var c = new ComboBox(e,function(value) {
var candidates = [];
for (var i=0; i<items.length; i++) {
if (items[i].indexOf(value)==0) {
candidates.push(items[i]);
if (candidates.length>20) break;
}
}
return candidates;
}, {});
refillOnChange(e,function(params) {
new Ajax.Request(e.getAttribute("fillUrl"),{
parameters: params,
onSuccess : function(rsp) {
items = eval('('+rsp.responseText+')');
}
});
});
},
"A.showDetails" : function(e) {
e.onclick = function() {
this.style.display = 'none';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册