[embed] Fix bug 58449

This commit is contained in:
JuliaSvinareva 2022-08-19 13:06:00 +03:00
parent eebf427798
commit ee80f3f78a
5 changed files with 40 additions and 1 deletions

View file

@ -106,6 +106,21 @@
} }
} }
}, },
shortcuts: function (options) {
var shortcuts = options;
require([
'common/main/lib/core/keymaster'
], function() {
window.key.filter = function() {
return true;
};
var shortcut, callback;
for (shortcut in shortcuts) {
callback = shortcuts[shortcut];
window.key(shortcut, 'all', callback);
}
});
},
isMac : isMac isMac : isMac
}; };

View file

@ -72,7 +72,7 @@
var key, handler, k, i, modifiersMatch, scope; var key, handler, k, i, modifiersMatch, scope;
key = event.keyCode; key = event.keyCode;
if (Common.UI.HintManager && Common.UI.HintManager.isHintVisible()) { if (Common.UI && Common.UI.HintManager && Common.UI.HintManager.isHintVisible()) {
if (key === 112) { if (key === 112) {
Common.UI.HintManager.clearHints(); Common.UI.HintManager.clearHints();
} else if (key !== 27) { } else if (key !== 27) {

View file

@ -525,6 +525,14 @@ DE.ApplicationController = new(function(){
common.controller.SearchBar.show(); common.controller.SearchBar.show();
}); });
var shortcuts = {
'command+f,ctrl+f': function() {
common.controller.SearchBar.show();
return false;
}
};
common.utils.shortcuts(shortcuts);
$('#id-btn-zoom-in').on('click', api.zoomIn.bind(this)); $('#id-btn-zoom-in').on('click', api.zoomIn.bind(this));
$('#id-btn-zoom-out').on('click', api.zoomOut.bind(this)); $('#id-btn-zoom-out').on('click', api.zoomOut.bind(this));

View file

@ -375,6 +375,14 @@ PE.ApplicationController = new(function(){
common.controller.SearchBar.show(); common.controller.SearchBar.show();
}); });
/*var shortcuts = {
'command+f,ctrl+f': function() {
common.controller.SearchBar.show();
return false;
}
};
common.utils.shortcuts(shortcuts);*/
var $pagenum = $('#page-number'); var $pagenum = $('#page-number');
$pagenum.on({ $pagenum.on({
'keyup': function(e){ 'keyup': function(e){

View file

@ -311,6 +311,14 @@ SSE.ApplicationController = new(function(){
common.controller.SearchBar.show(); common.controller.SearchBar.show();
}); });
var shortcuts = {
'command+f,ctrl+f': function() {
common.controller.SearchBar.show();
return false;
}
};
common.utils.shortcuts(shortcuts);
$('#id-btn-zoom-in').on('click', function () { $('#id-btn-zoom-in').on('click', function () {
if (api){ if (api){
var f = Math.floor(api.asc_getZoom() * 10)/10; var f = Math.floor(api.asc_getZoom() * 10)/10;