mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 04:38:55 +03:00
Experiment quick open Shortcuts Settings
This commit is contained in:
parent
1f039a4d73
commit
dc1452ab30
2 changed files with 29 additions and 2 deletions
|
@ -49,7 +49,24 @@ function Columns() {
|
|||
}
|
||||
});
|
||||
|
||||
return <div id="columns">{components}</div>;
|
||||
return (
|
||||
<div
|
||||
id="columns"
|
||||
onContextMenu={(e) => {
|
||||
// If right-click on header, but not links or buttons
|
||||
if (
|
||||
e.target.closest('.deck > header') &&
|
||||
!e.target.closest('a') &&
|
||||
!e.target.closest('button')
|
||||
) {
|
||||
e.preventDefault();
|
||||
states.showShortcutsSettings = true;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{components}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Columns;
|
||||
|
|
|
@ -90,7 +90,13 @@ function Shortcuts() {
|
|||
return (
|
||||
<div id="shortcuts">
|
||||
{snapStates.settings.shortcutsViewMode === 'tab-menu-bar' ? (
|
||||
<nav class="tab-bar">
|
||||
<nav
|
||||
class="tab-bar"
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
states.showShortcutsSettings = true;
|
||||
}}
|
||||
>
|
||||
<ul>
|
||||
{formattedShortcuts.map(
|
||||
({ id, path, title, subtitle, icon }, i) => {
|
||||
|
@ -146,6 +152,10 @@ function Shortcuts() {
|
|||
type="button"
|
||||
id="shortcuts-button"
|
||||
class="plain"
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
states.showShortcutsSettings = true;
|
||||
}}
|
||||
onTransitionStart={(e) => {
|
||||
// Close menu if the button disappears
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue