Skip to content

Commit

Permalink
Fill available space in widget window
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGon authored Jan 16, 2020
1 parent a2aaef6 commit e5e4721
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions js/widgets/musickeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function MusicKeyboard() {
widgetWindow.clear();


//Keyboard Table and Div
// Keyboard
this.keyboardDiv = document.createElement("div");
this.keyTable = document.createElement("div");
widgetWindow.getWidgetBody().append(this.keyboardDiv);
Expand All @@ -319,16 +319,22 @@ function MusicKeyboard() {
this._keysLayout();

var that = this;
//Change widget size on fullscreen mode, else

//Change widget size on fullscreen mode, else
//revert back to original size on unfullscreen mode
widgetWindow.onmaximize = function(){
if(widgetWindow._maximized){
widgetWindow.getWidgetBody().style.height = "700px";
widgetWindow.getWidgetBody().style.position = "absolute";
widgetWindow.getWidgetBody().style.height = "calc(100vh - 64px)";
widgetWindow.getWidgetBody().style.width = "200vh";
widgetWindow.getWidgetBody().style.left = "70px";
} else{
widgetWindow.getWidgetBody().style.position = "relative";
widgetWindow.getWidgetBody().style.left = "0px";
widgetWindow.getWidgetBody().style.height = "550px";
widgetWindow.getWidgetBody().style.width = "1000px";
}
};
}

widgetWindow.onclose = function() {
document.onkeydown = saveOnKeyDown;
Expand Down Expand Up @@ -392,7 +398,8 @@ function MusicKeyboard() {

this._createKeyboard();
this._createTable();
widgetWindow.sendToCenter();

widgetWindow.sendToCenter();

/*
this.toggleNotesButton = function () {
Expand Down

0 comments on commit e5e4721

Please sign in to comment.