Gitlab CSE Unil

Commit e1bbcad8 authored by M. Chardon's avatar M. Chardon
Browse files

améliorations visu canvas / taille fenêtre

parent 656dc31c
......@@ -6389,7 +6389,7 @@ EDITOR.prototype = {
* @method resize
*/
resize: function () {
var drawingregion, drawregionheight, drawregiontop;
var drawingregion, drawregionheight, drawregiontop, drawheaderheight, drawfooterheight;
if (this.dialogue) {
if (!this.dialogue.get('visible')) {
return;
......@@ -6402,11 +6402,21 @@ EDITOR.prototype = {
if (drawingregionheaderSelector.length > 0) {
var drawingregionheader = drawingregionheaderSelector[0];
drawregiontop = drawingregionheader.getBoundingClientRect().height;
drawheaderheight = drawingregionheader.getBoundingClientRect().bottom;
} else {
drawregiontop = '52';
drawregiontop = 52;
drawheaderheight = 170;
}
//get footer's height
var footer = document.querySelector("div[data-region='grade-actions-panel']");
if (footer) {
drawfooterheight = footer.getBoundingClientRect().height;
} else {
drawfooterheight = 60;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight = Y.one('body').get('winHeight') - 120; // Space for toolbar + titlebar.
// be careful to remove space for toolbar + titlebar.
drawregionheight = Y.one('body').get('winHeight') - (drawfooterheight + drawheaderheight);
if (drawregionheight < 100) {
drawregionheight = 100;
}
......
......@@ -6389,7 +6389,7 @@ EDITOR.prototype = {
* @method resize
*/
resize: function () {
var drawingregion, drawregionheight, drawregiontop;
var drawingregion, drawregionheight, drawregiontop, drawheaderheight, drawfooterheight;
if (this.dialogue) {
if (!this.dialogue.get('visible')) {
return;
......@@ -6402,11 +6402,21 @@ EDITOR.prototype = {
if (drawingregionheaderSelector.length > 0) {
var drawingregionheader = drawingregionheaderSelector[0];
drawregiontop = drawingregionheader.getBoundingClientRect().height;
drawheaderheight = drawingregionheader.getBoundingClientRect().bottom;
} else {
drawregiontop = '52';
drawregiontop = 52;
drawheaderheight = 170;
}
//get footer's height
var footer = document.querySelector("div[data-region='grade-actions-panel']");
if (footer) {
drawfooterheight = footer.getBoundingClientRect().height;
} else {
drawfooterheight = 60;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight = Y.one('body').get('winHeight') - 120; // Space for toolbar + titlebar.
// be careful to remove space for toolbar + titlebar.
drawregionheight = Y.one('body').get('winHeight') - (drawfooterheight + drawheaderheight);
if (drawregionheight < 100) {
drawregionheight = 100;
}
......
......@@ -1344,7 +1344,7 @@ EDITOR.prototype = {
* @method resize
*/
resize: function () {
var drawingregion, drawregionheight, drawregiontop;
var drawingregion, drawregionheight, drawregiontop, drawheaderheight, drawfooterheight;
if (this.dialogue) {
if (!this.dialogue.get('visible')) {
return;
......@@ -1357,11 +1357,21 @@ EDITOR.prototype = {
if (drawingregionheaderSelector.length > 0) {
var drawingregionheader = drawingregionheaderSelector[0];
drawregiontop = drawingregionheader.getBoundingClientRect().height;
drawheaderheight = drawingregionheader.getBoundingClientRect().bottom;
} else {
drawregiontop = '52';
drawregiontop = 52;
drawheaderheight = 170;
}
//get footer's height
var footer = document.querySelector("div[data-region='grade-actions-panel']");
if (footer) {
drawfooterheight = footer.getBoundingClientRect().height;
} else {
drawfooterheight = 60;
}
// Make sure the dialogue box is not bigger than the max height of the viewport.
drawregionheight = Y.one('body').get('winHeight') - 120; // Space for toolbar + titlebar.
// be careful to remove space for toolbar + titlebar.
drawregionheight = Y.one('body').get('winHeight') - (drawfooterheight + drawheaderheight);
if (drawregionheight < 100) {
drawregionheight = 100;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment