зеркало из https://github.com/mozilla/gecko-dev.git
Bug 759238 - Prevent Virtual Keyboard from covering the textboxes; r=vingtetun
This commit is contained in:
Родитель
084dfb0f93
Коммит
5494e9727b
|
@ -49,6 +49,12 @@ XPCOMUtils.defineLazyServiceGetter(Services, 'fm',
|
|||
let constructor = {
|
||||
handleEvent: function vkm_handleEvent(evt) {
|
||||
switch (evt.type) {
|
||||
case 'resize':
|
||||
if (!isKeyboardOpened)
|
||||
return;
|
||||
|
||||
activeElement.scrollIntoView(false);
|
||||
break;
|
||||
case 'keypress':
|
||||
if (evt.keyCode != evt.DOM_VK_ESCAPE || !isKeyboardOpened)
|
||||
return;
|
||||
|
@ -84,7 +90,7 @@ XPCOMUtils.defineLazyServiceGetter(Services, 'fm',
|
|||
};
|
||||
|
||||
Services.obs.addObserver(constructor, 'ime-enabled-state-changed', false);
|
||||
['keypress', 'mousedown'].forEach(function vkm_events(type) {
|
||||
['keypress', 'mousedown', 'resize'].forEach(function vkm_events(type) {
|
||||
addEventListener(type, constructor, true);
|
||||
});
|
||||
})();
|
||||
|
|
Загрузка…
Ссылка в новой задаче