mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-26 21:16:57 +08:00
[embed] Fix bug 58449
This commit is contained in:
@ -51,7 +51,41 @@
|
||||
searchText: ''
|
||||
},
|
||||
_lastInputChange,
|
||||
_searchTimer;
|
||||
_searchTimer,
|
||||
_mods = {
|
||||
ctrl: false,
|
||||
f: false,
|
||||
other: false
|
||||
};
|
||||
|
||||
var init = function (config) {
|
||||
appConfig = config;
|
||||
|
||||
$(document.body).on('keydown', function (event) {
|
||||
if (event.keyCode === 27 && $searchBar && $searchBar.is(':visible')) {
|
||||
highlightResults(false);
|
||||
$searchBar.hide();
|
||||
return;
|
||||
}
|
||||
if (event.keyCode === 70) {
|
||||
_mods.f = true;
|
||||
}
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
_mods.ctrl = true;
|
||||
}
|
||||
if (event.altKey || event.shiftKey) {
|
||||
_mods.other = true;
|
||||
}
|
||||
if (_mods.f && _mods.ctrl && !_mods.other) {
|
||||
event.preventDefault()
|
||||
onShow();
|
||||
}
|
||||
}).on('keyup', function () {
|
||||
for (var key in _mods) {
|
||||
_mods[key] = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var setApi = function (appApi) {
|
||||
api = appApi;
|
||||
@ -165,7 +199,7 @@
|
||||
};
|
||||
|
||||
return {
|
||||
init: function(config) { appConfig = config; },
|
||||
init: init,
|
||||
setApi: setApi,
|
||||
show: onShow
|
||||
};
|
||||
|
||||
@ -51,7 +51,41 @@
|
||||
searchText: ''
|
||||
},
|
||||
_lastInputChange,
|
||||
_searchTimer;
|
||||
_searchTimer,
|
||||
_mods = {
|
||||
ctrl: false,
|
||||
f: false,
|
||||
other: false
|
||||
};
|
||||
|
||||
var init = function (config) {
|
||||
appConfig = config;
|
||||
|
||||
$(document.body).on('keydown', function (event) {
|
||||
if (event.keyCode === 27 && $searchBar && $searchBar.is(':visible')) {
|
||||
highlightResults(false);
|
||||
$searchBar.hide();
|
||||
return;
|
||||
}
|
||||
if (event.keyCode === 70) {
|
||||
_mods.f = true;
|
||||
}
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
_mods.ctrl = true;
|
||||
}
|
||||
if (event.altKey || event.shiftKey) {
|
||||
_mods.other = true;
|
||||
}
|
||||
if (_mods.f && _mods.ctrl && !_mods.other) {
|
||||
event.preventDefault()
|
||||
onShow();
|
||||
}
|
||||
}).on('keyup', function () {
|
||||
for (var key in _mods) {
|
||||
_mods[key] = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var setApi = function (appApi) {
|
||||
api = appApi;
|
||||
@ -171,7 +205,7 @@
|
||||
};
|
||||
|
||||
return {
|
||||
init: function(config) { appConfig = config; },
|
||||
init: init,
|
||||
setApi: setApi,
|
||||
show: onShow
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user