Skip to content

Commit

Permalink
Open editor in a new tab when pressing the ctrl key
Browse files Browse the repository at this point in the history
  • Loading branch information
torinfo committed Oct 8, 2020
1 parent b73b05e commit 139d710
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 5 additions & 1 deletion website_code/scripts/screen_display.js
Expand Up @@ -394,7 +394,11 @@ function button_check(){
if (e.shiftKey) {
edit_window(false, "edit");
}
else {
else if (e.ctrlKey) {
edit_window(false, "edithtml", "_blank");
}
else
{
edit_window(false, "edithtml");
}
};
Expand Down
20 changes: 14 additions & 6 deletions website_code/scripts/template_management.js
Expand Up @@ -195,7 +195,7 @@ function toggle(tag) {
* @author Patrick Lockley
*/

function edit_window(admin, edit) {
function edit_window(admin, edit, location) {

if (!admin) {

Expand Down Expand Up @@ -227,11 +227,19 @@ function edit_window(admin, edit) {

size = node.editor_size.split(",");

if (size.length == 1) {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), "editwindow" + node.id);
} else {
var NewEditWindow = window.open(site_url + url_return(edit, node.xot_id), "editwindow" + node.id, "height=" + size[1] + ", width=" +
size[0] + ", resizable=yes");
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');
}
}
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");
}
}

try {
Expand Down

0 comments on commit 139d710

Please sign in to comment.