Fix resize

This commit is contained in:
Marcos Lilljedahl
2019-08-25 14:55:26 -03:00
parent bfde6dfc24
commit 8d1065bccc

View File

@@ -63,11 +63,12 @@
$scope.resizeHandler = null; $scope.resizeHandler = null;
angular.element($window).bind('resize', function() { angular.element($window).bind('resize', function() {
console.log('windows resize');
if ($rootScope.selectedInstance) { if ($rootScope.selectedInstance) {
if (!$scope.resizeHandler) { if (!$scope.resizeHandler) {
$scope.resizeHandler = setTimeout(function() { $scope.resizeHandler = setTimeout(function() {
$scope.resizeHandler = null $scope.resizeHandler = null
$rootScope.selectedInstance.term.fit(); $scope.resize($scope.selectedInstance.term.proposeGeometry());
}, 1000); }, 1000);
} }
} }
@@ -470,9 +471,9 @@
var term = new Terminal({ var term = new Terminal({
cursorBlink: false cursorBlink: false
}); });
term.open(terminalContainer); term.open(terminalContainer);
const handleCopy = (e) => { const handleCopy = (e) => {
// Ctrl + Alt + C // Ctrl + Alt + C
@@ -756,10 +757,10 @@
function getAvailablePresets() { function getAvailablePresets() {
return [ return [
{ {
name : "None", name : "None",
presets : [ presets : [
{ {
description : "Toggle terminal fullscreen", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullScreen(context.terminal, resizeFunc); } description : "Toggle terminal fullscreen", command : "Alt+enter", altKey : true, keyCode : 13, action : function(context) { TerminalService.toggleFullScreen(context.terminal, resizeFunc); }
}, },
{ {
@@ -782,7 +783,7 @@
TerminalService.decreaseFontSize(); TerminalService.decreaseFontSize();
} }
} }
] ]
}, },
{ {
name : "Mac OSX", name : "Mac OSX",
@@ -861,7 +862,7 @@
function getFontSize() { function getFontSize() {
if($rootScope.selectedInstance){ if($rootScope.selectedInstance){
return $rootScope.selectedInstance.term.getOption("fontSize") + "px" return $rootScope.selectedInstance.term.getOption("fontSize") + "px"
}else{ }else{
return $(".terminal").css("font-size") return $(".terminal").css("font-size")
} }
} }