mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-28 15:05:46 +01:00
Better option list filtering.
This commit is contained in:
@@ -854,6 +854,11 @@ var Options = Module("options", {
|
||||
|
||||
function opts(opt) {
|
||||
for (let opt in Iterator(this)) {
|
||||
if (filter && !filter(opt))
|
||||
continue;
|
||||
if (!(opt.scope & scope))
|
||||
continue;
|
||||
|
||||
let option = {
|
||||
__proto__: opt,
|
||||
isDefault: opt.isDefault,
|
||||
@@ -862,11 +867,6 @@ var Options = Module("options", {
|
||||
value: []
|
||||
};
|
||||
|
||||
if (filter && !filter(opt))
|
||||
continue;
|
||||
if (!(opt.scope & scope))
|
||||
continue;
|
||||
|
||||
if (opt.type == "boolean") {
|
||||
if (!opt.value)
|
||||
option.pre = "no";
|
||||
|
||||
Reference in New Issue
Block a user