mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
Bug 661831 - In about:permissions, make Ctrl+f focus the filter box instead of invoking the find bar
This commit is contained in:
parent
7a70b9241b
commit
b42ce19494
3 changed files with 23 additions and 4 deletions
|
|
@ -483,6 +483,14 @@ var AboutPermissions = {
|
||||||
*/
|
*/
|
||||||
_sites: {},
|
_sites: {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Using a getter for sitesFilter to avoid races with tests.
|
||||||
|
*/
|
||||||
|
get sitesFilter () {
|
||||||
|
delete this.sitesFilter;
|
||||||
|
return this.sitesFilter = document.getElementById("sites-filter");
|
||||||
|
},
|
||||||
|
|
||||||
sitesList: null,
|
sitesList: null,
|
||||||
_selectedSite: null,
|
_selectedSite: null,
|
||||||
|
|
||||||
|
|
@ -949,8 +957,7 @@ var AboutPermissions = {
|
||||||
aSite.listitem = item;
|
aSite.listitem = item;
|
||||||
|
|
||||||
// Make sure to only display relevant items when list is filtered.
|
// Make sure to only display relevant items when list is filtered.
|
||||||
let filterValue =
|
let filterValue = this.sitesFilter.value.toLowerCase();
|
||||||
document.getElementById("sites-filter").value.toLowerCase();
|
|
||||||
item.collapsed = aSite.host.toLowerCase().indexOf(filterValue) == -1;
|
item.collapsed = aSite.host.toLowerCase().indexOf(filterValue) == -1;
|
||||||
|
|
||||||
(this._listFragment || this.sitesList).appendChild(item);
|
(this._listFragment || this.sitesList).appendChild(item);
|
||||||
|
|
@ -973,8 +980,7 @@ var AboutPermissions = {
|
||||||
*/
|
*/
|
||||||
filterSitesList: function() {
|
filterSitesList: function() {
|
||||||
let siteItems = this.sitesList.children;
|
let siteItems = this.sitesList.children;
|
||||||
let filterValue =
|
let filterValue = this.sitesFilter.value.toLowerCase();
|
||||||
document.getElementById("sites-filter").value.toLowerCase();
|
|
||||||
|
|
||||||
if (filterValue == "") {
|
if (filterValue == "") {
|
||||||
for (let i = 0, iLen = siteItems.length; i < iLen; i++) {
|
for (let i = 0, iLen = siteItems.length; i < iLen; i++) {
|
||||||
|
|
@ -1350,6 +1356,13 @@ var AboutPermissions = {
|
||||||
window.openDialog("chrome://browser/content/preferences/cookies.xul",
|
window.openDialog("chrome://browser/content/preferences/cookies.xul",
|
||||||
"Browser:Cookies", "", {filterString : selectedDomain});
|
"Browser:Cookies", "", {filterString : selectedDomain});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Focusses the filter box.
|
||||||
|
*/
|
||||||
|
focusFilterBox: function() {
|
||||||
|
this.sitesFilter.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@
|
||||||
<script type="application/javascript"
|
<script type="application/javascript"
|
||||||
src="chrome://browser/content/preferences/aboutPermissions.js"/>
|
src="chrome://browser/content/preferences/aboutPermissions.js"/>
|
||||||
|
|
||||||
|
<keyset>
|
||||||
|
<key key="&focusSearch.key;" modifiers="accel" oncommand="AboutPermissions.focusFilterBox();"/>
|
||||||
|
</keyset>
|
||||||
|
|
||||||
<hbox flex="1" id="permissions-header">
|
<hbox flex="1" id="permissions-header">
|
||||||
<label id="permissions-pagetitle">&permissionsManager.title;</label>
|
<label id="permissions-pagetitle">&permissionsManager.title;</label>
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
|
||||||
|
|
@ -56,3 +56,5 @@
|
||||||
<!ENTITY pointerLock.label "Hide the Mouse Pointer">
|
<!ENTITY pointerLock.label "Hide the Mouse Pointer">
|
||||||
|
|
||||||
<!ENTITY push.label "Receive Push Notifications">
|
<!ENTITY push.label "Receive Push Notifications">
|
||||||
|
|
||||||
|
<!ENTITY focusSearch.key "f">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue