Skip to content

Commit

Permalink
Merge pull request #935 from cowuake/devel
Browse files Browse the repository at this point in the history
Fix zoom behavior on mobile
  • Loading branch information
jcubic committed Apr 29, 2024
2 parents df3506a + e94c9c3 commit 8615ac7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/jquery.terminal-src.js
Expand Up @@ -5297,10 +5297,12 @@
// :: is that it's triggers when virtual keyboard is toggled
// -------------------------------------------------------------------------
function on_height_change(callback) {
var height = window.visualViewport.height;
var scale = window.visualViewport.scale;
var height = Math.round(window.visualViewport.height * scale);
callback(height);
window.visualViewport.addEventListener('resize', function() {
var newHeight = window.visualViewport.height;
var newScale = window.visualViewport.scale;
var newHeight = Math.round(window.visualViewport.height * newScale);
if (height !== newHeight) {
height = newHeight;
callback(height);
Expand Down

0 comments on commit 8615ac7

Please sign in to comment.