mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
Disable 'FocusFilter'-Hotkey if command palette is visible (#5887)
Co-authored-by: Marc Bernard <59966492+mbtools@users.noreply.github.com>
This commit is contained in:
parent
9c4ebba400
commit
8c1752f13c
|
@ -284,7 +284,7 @@ RepoOverViewHelper.prototype.registerKeyboardShortcuts = function() {
|
|||
if (document.activeElement.id === "filter") {
|
||||
return;
|
||||
}
|
||||
if (self.focusFilterKey && event.key === self.focusFilterKey) {
|
||||
if (self.focusFilterKey && event.key === self.focusFilterKey && !CommandPalette.isVisible()) {
|
||||
var filterInput = document.getElementById("filter");
|
||||
if (filterInput) filterInput.focus();
|
||||
event.preventDefault();
|
||||
|
@ -551,7 +551,8 @@ StageHelper.prototype.setHooks = function() {
|
|||
var self = this;
|
||||
document.addEventListener("keypress", function(event) {
|
||||
if (document.activeElement.id !== self.ids.objectSearch
|
||||
&& self.focusFilterKey && event.key === self.focusFilterKey) {
|
||||
&& self.focusFilterKey && event.key === self.focusFilterKey
|
||||
&& !CommandPalette.isVisible()) {
|
||||
|
||||
self.dom.objectSearch.focus();
|
||||
event.preventDefault();
|
||||
|
@ -2356,6 +2357,11 @@ CommandPalette.prototype.exec = function(cmd) {
|
|||
}
|
||||
};
|
||||
|
||||
// Is any command palette visible?
|
||||
CommandPalette.isVisible = function(){
|
||||
return CommandPalette.instances.reduce(function(result, instance){ return result || instance.elements.palette.style.display !== "none" }, false);
|
||||
};
|
||||
|
||||
/* COMMAND ENUMERATORS */
|
||||
|
||||
function createRepoCatalogEnumerator(catalog, action) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user