зеркало из https://github.com/mozilla/pjs.git
Fix for bug 40591. r=scc, alecf a=pink
This commit is contained in:
Родитель
4c6eb7548b
Коммит
d1f84e4134
|
@ -550,9 +550,18 @@ function doStop()
|
|||
|
||||
function doSearch()
|
||||
{
|
||||
var searchButton = document.getElementById("searchbutton");
|
||||
if ( searchButton.getAttribute("disabled") )
|
||||
{
|
||||
var sidebarSearchText = document.getElementById("sidebar-search-text");
|
||||
sidebarSearchText.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
//get click count pref for later
|
||||
//and set tree attribute to cause proper results appearance (like links) to happen
|
||||
//when user set pref to single click
|
||||
|
||||
try {
|
||||
if( pref ) {
|
||||
var prefvalue = pref.GetBoolPref( "browser.search.use_double_clicks" );
|
||||
|
@ -1013,3 +1022,21 @@ function doCustomize()
|
|||
{
|
||||
window.openDialog("chrome://communicator/content/search/search-editor.xul", "_blank", "centerscreen,chrome,resizable");
|
||||
}
|
||||
|
||||
function doEnabling()
|
||||
{
|
||||
var searchButton = document.getElementById("searchbutton");
|
||||
var sidebarSearchText = document.getElementById("sidebar-search-text");
|
||||
|
||||
if ( sidebarSearchText.value == "" )
|
||||
{
|
||||
// No input, disable search button if enabled.
|
||||
if ( !searchButton.getAttribute("disabled") )
|
||||
searchButton.setAttribute("disabled","true");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( searchButton.getAttribute("disabled") == "true")
|
||||
searchButton.removeAttribute( "disabled");
|
||||
}
|
||||
}
|
|
@ -44,9 +44,9 @@
|
|||
</popupset>
|
||||
<box orient="vertical">
|
||||
<box autostretch="never">
|
||||
<textfield id="sidebar-search-text" flex="1" onkeypress="if (event.which == 13) { return doSearch(); }" />
|
||||
<textfield id="sidebar-search-text" flex="1" onkeypress="if (event.which == 13) { return doSearch(); } else {doEnabling();}" />
|
||||
<box autostretch="never">
|
||||
<button class="button-toolbar-3" id="searchbutton" value="&search.button.label;" oncommand="return doSearch();"/>
|
||||
<button class="button-toolbar-3" id="searchbutton" value="&search.button.label;" disabled="true" oncommand="return doSearch();}"/>
|
||||
<button class="button-toolbar-3" id="stopbutton" align="left" src="resource:/res/rdf/loading.gif" value="&stop.button.label;" oncommand="return doStop();" style="display:none;"/>
|
||||
</box>
|
||||
</box>
|
||||
|
|
Загрузка…
Ссылка в новой задаче