提交 ff7b943c 编写于 作者: D ddavison

Reverting to head for layout.jelly, and adding the default `has-default-text`...

Reverting to head for layout.jelly, and adding the default `has-default-text` back into the search box
上级 0537ffad
......@@ -170,7 +170,7 @@ ${h.initPageVariables(context)}
<!-- this div is used to calculate the width of the text box -->
<div id="search-box-sizer"/>
<div id="searchform">
<input name="q" placeholder="${%search}" id="search-box" />
<input name="q" placeholder="${%search}" id="search-box" class="has-default-text" />
<st:nbsp />
<a href="${%searchBox.url}"><img src="${imagesURL}/16x16/help.png" alt="help for search" height="16" width="16" /></a>
<div id="search-box-completion" />
......
......@@ -607,6 +607,25 @@ var jenkinsRules = {
e = null; // avoid memory leak
},
// scripting for having default value in the input field
"INPUT.has-default-text" : function(e) {
var defaultValue = e.value;
Element.addClassName(e, "defaulted");
e.onfocus = function() {
if (this.value == defaultValue) {
this.value = "";
Element.removeClassName(this, "defaulted");
}
}
e.onblur = function() {
if (this.value == "") {
this.value = defaultValue;
Element.addClassName(this, "defaulted");
}
}
e = null; // avoid memory leak
},
// <label> that doesn't use ID, so that it can be copied in <repeatable>
"LABEL.attach-previous" : function(e) {
e.onclick = function() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册