提交 3a52fb08 编写于 作者: K kohsuke

added resizable text area support.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4938 71c3de6d-444a-0410-be80-ed276b4c234a
上级 efd78967
......@@ -652,3 +652,17 @@ DIV.yahooTree td {
position:absolute;
visibility: hidden;
}
/* ========================= resizable text area ========================= */
TEXTAREA {
margin-bottom: 0;
}
DIV.textarea-handle {
height: 5px;
font-size: 0;
background: #EEE url(../images/textarea-handle.gif) no-repeat 50% 1px;
border: 1px solid #BABDB6;
border-top: none;
cursor: s-resize;
}
\ No newline at end of file
此差异由.gitattributes 抑制。
......@@ -239,6 +239,26 @@ var hudsonRules = {
object(repetableSupport).init(e, e.firstChild, ip);
},
// resizable text area
"TEXTAREA" : function(textarea) {
var handle = document.createElement("div");
handle.setAttribute("class","textarea-handle");
textarea.parentNode.insertBefore(handle,textarea.nextSibling);
handle.onmousedown = function(ev) {
var offset = textarea.offsetHeight-YAHOO.util.Event.getPageY(ev);
textarea.style.opacity = 0.5;
document.onmousemove = function(ev) {
function max(a,b) { if(a<b) return b; else return a; }
textarea.style.height = max(32, offset + YAHOO.util.Event.getPageY(ev)) + 'px';
};
document.onmouseup = function() {
document.onmousemove = null;
document.onmouseup = null;
textarea.style.opacity = 1;
}
}
},
// hook up tooltip
"[tooltip]" : function(e) {
// copied from YAHOO.widget.Tooltip.prototype.configContext to efficiently add a new element
......@@ -264,6 +284,7 @@ function replaceDescription() {
method : 'get',
onComplete : function(x) {
d.innerHTML = x.responseText;
Behaviour.applySubtree(d);
d.getElementsByTagName("TEXTAREA")[0].focus();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册