mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 10:36:21 +00:00
Reverting to head for layout.jelly, and adding the default has-default-text back into the search box
This commit is contained in:
1 parent
0537ffada6
commit
ff7b943c8d
2 files changed
+20
-1
No files matched your search
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user