Skip to content

Commit

Permalink
Use editor size specified in info again
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Oct 5, 2021
1 parent 547de6c commit 7ad0d9a
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions website_code/scripts/template_management.js
Expand Up @@ -225,20 +225,38 @@ function edit_window(admin, edit, location) {
console.log("Window open parent: " + window_open.parent);
if (!window_open || window_open.parent == null) {

size = node.editor_size.split(",");
let size = node.editor_size.split(",");
let swidth = window.screen.width;
let sheight = window.screen.height;
if (size[0].indexOf('%') >= 0)
{
let sizew = parseInt(size[0]);
let sizeh = parseInt(size[1]);
if (sizew <= 100 && sizeh <= 100)
{
size[0] = (sizew * swidth) / 100;
size[1] = (sizeh * sheight) / 100;
}
if (size[0] < 1280 && swidth > 1280)
size[0] = 1280;
if (size[1] < 768 && sheight > 768)
size[1] = 768;
}
if (size[0] > swidth)
size[0] = swidth;
if (size[1] > sheight)
size[1] = sheight;


if (location != null) {
if (size.length == 1) {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), location);
} else {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), '_blank');
}
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), location);
}
else {
if (size.length == 1) {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), "editwindow" + node.id, "toolbar=yes,location=yes");
} else {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), "editwindow" + node.id, "toolbar=yes,location=yes,resizable=yes");
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), "editwindow" + node.id, "height=" + size[1] + ", width=" +
size[0] + ",toolbar=yes,location=yes,resizable=yes");
}
}

Expand Down

0 comments on commit 7ad0d9a

Please sign in to comment.