mirror of
https://github.com/ManchildProductions/UXP-Fixed.git
synced 2026-07-10 04:19:45 +00:00
Prevent the Quickdial page from stealing focus from the address bar.
This commit is contained in:
@@ -267,8 +267,7 @@ input[type=button] {
|
||||
}
|
||||
|
||||
#searchText[keepfocus],
|
||||
#searchText:focus,
|
||||
#searchText[autofocus] {
|
||||
#searchText:focus {
|
||||
border-color: hsla(216,100%,60%,.6) hsla(216,76%,52%,.6) hsla(214,100%,40%,.6);
|
||||
}
|
||||
|
||||
@@ -299,14 +298,12 @@ input[type=button] {
|
||||
}
|
||||
|
||||
#searchText:focus + #searchSubmit,
|
||||
#searchText + #searchSubmit:hover,
|
||||
#searchText[autofocus] + #searchSubmit {
|
||||
#searchText + #searchSubmit:hover {
|
||||
border-color: #5985fc #4573e7 #3264d5;
|
||||
}
|
||||
|
||||
#searchText:focus + #searchSubmit,
|
||||
#searchText[keepfocus] + #searchSubmit,
|
||||
#searchText[autofocus] + #searchSubmit {
|
||||
#searchText[keepfocus] + #searchSubmit {
|
||||
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
|
||||
0 0 0 1px hsla(0,0%,100%,.1) inset,
|
||||
0 1px 0 hsla(220,54%,20%,.03);
|
||||
|
||||
@@ -40,8 +40,7 @@
|
||||
<div id="searchContainer">
|
||||
<form name="searchForm" id="searchForm" onsubmit="onSearchSubmit(event)">
|
||||
<div id="searchLogoContainer"><img id="searchEngineLogo"/></div>
|
||||
<input type="text" name="q" value="" id="searchText" maxlength="256"
|
||||
autofocus="autofocus"/>
|
||||
<input type="text" name="q" value="" id="searchText" maxlength="256"/>
|
||||
<input id="searchSubmit" type="submit" value="&newtab.searchEngineButton.label;"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -116,15 +116,6 @@ function onSearchSubmit(aEvent) {
|
||||
|
||||
|
||||
function setupSearchEngine() {
|
||||
// The "autofocus" attribute doesn't focus the form element
|
||||
// immediately when the element is first drawn, so the
|
||||
// attribute is also used for styling when the page first loads.
|
||||
let searchText = document.getElementById("searchText");
|
||||
searchText.addEventListener("blur", function searchText_onBlur() {
|
||||
searchText.removeEventListener("blur", searchText_onBlur);
|
||||
searchText.removeAttribute("autofocus");
|
||||
});
|
||||
|
||||
let searchEngineName = document.documentElement.getAttribute("searchEngineName");
|
||||
let searchEngineInfo = SEARCH_ENGINES[searchEngineName];
|
||||
let logoElt = document.getElementById("searchEngineLogo");
|
||||
@@ -139,5 +130,4 @@ function setupSearchEngine() {
|
||||
logoElt.parentNode.hidden = true;
|
||||
searchText.placeholder = searchEngineName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user