mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 15:27:30 +09:00
Prevent the Quickdial page from stealing focus from the address bar.
This commit is contained in:
parent
f639bba29f
commit
a4f3536b05
3 changed files with 4 additions and 18 deletions
|
|
@ -267,8 +267,7 @@ input[type=button] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchText[keepfocus],
|
#searchText[keepfocus],
|
||||||
#searchText:focus,
|
#searchText:focus {
|
||||||
#searchText[autofocus] {
|
|
||||||
border-color: hsla(216,100%,60%,.6) hsla(216,76%,52%,.6) hsla(214,100%,40%,.6);
|
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:focus + #searchSubmit,
|
||||||
#searchText + #searchSubmit:hover,
|
#searchText + #searchSubmit:hover {
|
||||||
#searchText[autofocus] + #searchSubmit {
|
|
||||||
border-color: #5985fc #4573e7 #3264d5;
|
border-color: #5985fc #4573e7 #3264d5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchText:focus + #searchSubmit,
|
#searchText:focus + #searchSubmit,
|
||||||
#searchText[keepfocus] + #searchSubmit,
|
#searchText[keepfocus] + #searchSubmit {
|
||||||
#searchText[autofocus] + #searchSubmit {
|
|
||||||
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
|
box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset,
|
||||||
0 0 0 1px hsla(0,0%,100%,.1) inset,
|
0 0 0 1px hsla(0,0%,100%,.1) inset,
|
||||||
0 1px 0 hsla(220,54%,20%,.03);
|
0 1px 0 hsla(220,54%,20%,.03);
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,7 @@
|
||||||
<div id="searchContainer">
|
<div id="searchContainer">
|
||||||
<form name="searchForm" id="searchForm" onsubmit="onSearchSubmit(event)">
|
<form name="searchForm" id="searchForm" onsubmit="onSearchSubmit(event)">
|
||||||
<div id="searchLogoContainer"><img id="searchEngineLogo"/></div>
|
<div id="searchLogoContainer"><img id="searchEngineLogo"/></div>
|
||||||
<input type="text" name="q" value="" id="searchText" maxlength="256"
|
<input type="text" name="q" value="" id="searchText" maxlength="256"/>
|
||||||
autofocus="autofocus"/>
|
|
||||||
<input id="searchSubmit" type="submit" value="&newtab.searchEngineButton.label;"/>
|
<input id="searchSubmit" type="submit" value="&newtab.searchEngineButton.label;"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -116,15 +116,6 @@ function onSearchSubmit(aEvent) {
|
||||||
|
|
||||||
|
|
||||||
function setupSearchEngine() {
|
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 searchEngineName = document.documentElement.getAttribute("searchEngineName");
|
||||||
let searchEngineInfo = SEARCH_ENGINES[searchEngineName];
|
let searchEngineInfo = SEARCH_ENGINES[searchEngineName];
|
||||||
let logoElt = document.getElementById("searchEngineLogo");
|
let logoElt = document.getElementById("searchEngineLogo");
|
||||||
|
|
@ -139,5 +130,4 @@ function setupSearchEngine() {
|
||||||
logoElt.parentNode.hidden = true;
|
logoElt.parentNode.hidden = true;
|
||||||
searchText.placeholder = searchEngineName;
|
searchText.placeholder = searchEngineName;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue