improved window tiling

This commit is contained in:
Stephan Richter
2020-10-11 12:06:14 +02:00
parent 3dc11c18e1
commit 8e747cb2a0
9 changed files with 154 additions and 111 deletions

View File

@@ -51,6 +51,7 @@ function closeMenu(ev){
function closeWindows(){
$('.window').remove();
$('#plan').css('height','').css('width','');
}
function connectCu(){
@@ -158,8 +159,13 @@ function request(data){
if (resp.startsWith('<svg')){
$(PLAN).append($(resp));
} else if (resp.startsWith('<')) {
// console.log("appending to body: "+resp.substring(0,10));
var isWindow = $(resp).attr('class') == 'window';
if (isWindow){
$('.window').remove();
$('#plan').css('height','50%');
}
$(BODY).append($(resp));
$('.window').css('height','50%');
} else {
addMessage(resp);
}
@@ -185,6 +191,18 @@ function stream(ev){
if (data.startsWith("dropclass")) return dropClass(data.substring(10));
}
function swapTiling(ev){
if ($('.swapbtn').text() == '◧'){
$('.swapbtn').text('⬒');
$('.window').css('height','').css('width','50%');
$(PLAN).css('height','').css('width','50%');
} else {
$('.swapbtn').text('◧');
$('.window').css('height','50%').css('width','');
$(PLAN).css('height','50%').css('width','');
}
}
function train(id,action){
return request({realm:'train',action:action,id:id});
}