Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
4ed39cf0
Commit
4ed39cf0
authored
Mar 08, 2023
by
pythongosssss
Browse files
Added invert scrolling setting
parent
863e747d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
web/extensions/core/invertMenuScrolling.js
web/extensions/core/invertMenuScrolling.js
+36
-0
No files found.
web/extensions/core/invertMenuScrolling.js
0 → 100644
View file @
4ed39cf0
import
{
app
}
from
"
/scripts/app.js
"
;
// Inverts the scrolling of context menus
const
id
=
"
Comfy.InvertMenuScrolling
"
;
const
ctxMenu
=
LiteGraph
.
ContextMenu
;
app
.
registerExtension
({
name
:
id
,
init
()
{
const
replace
=
()
=>
{
LiteGraph
.
ContextMenu
=
function
(
values
,
options
)
{
options
=
options
||
{};
if
(
options
.
scroll_speed
)
{
options
.
scroll_speed
*=
-
1
;
}
else
{
options
.
scroll_speed
=
-
0.1
;
}
return
ctxMenu
.
call
(
this
,
values
,
options
);
};
LiteGraph
.
ContextMenu
.
prototype
=
ctxMenu
.
prototype
;
};
app
.
ui
.
settings
.
addSetting
({
id
,
name
:
"
Invert Menu Scrolling
"
,
type
:
"
boolean
"
,
defaultValue
:
false
,
onChange
(
value
)
{
if
(
value
)
{
replace
();
}
else
{
LiteGraph
.
ContextMenu
=
ctxMenu
;
}
},
});
},
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment