mirror of https://github.com/node-red/node-red.git
Add several click-outside-edit-tray behaviours
parent
6a75a084ad
commit
2334b34541
|
|
@ -160,7 +160,13 @@
|
|||
"moveToBack": "Move to back",
|
||||
"moveToFront": "Move to front",
|
||||
"moveBackwards": "Move backwards",
|
||||
"moveForwards": "Move forwards"
|
||||
"moveForwards": "Move forwards",
|
||||
"clickOutsideEditTray": "Click behavior outside the edit tray",
|
||||
"clickOptions": {
|
||||
"nothing": "Do nothing",
|
||||
"discard": "Discard changes and close",
|
||||
"save": "Save changes and close"
|
||||
}
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
|
|
|
|||
|
|
@ -160,7 +160,13 @@
|
|||
"moveToBack": "Déplacer vers l'arrière",
|
||||
"moveToFront": "Déplacer vers l'avant",
|
||||
"moveBackwards": "Reculer",
|
||||
"moveForwards": "Avancer"
|
||||
"moveForwards": "Avancer",
|
||||
"clickOutsideEditTray": "Comportement du clic en dehors de la zone d'édition",
|
||||
"clickOptions": {
|
||||
"nothing": "Ne rien faire",
|
||||
"discard": "Annuler les modifications et fermer",
|
||||
"save": "Enregistrer les modifications et fermer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"actions": {
|
||||
|
|
|
|||
|
|
@ -230,6 +230,21 @@
|
|||
editorStack = $("#red-ui-editor-stack");
|
||||
$(window).on("resize", handleWindowResize);
|
||||
RED.events.on("sidebar:resize",handleWindowResize);
|
||||
$("#red-ui-editor-shade").on("click", function () {
|
||||
if (openingTray) { return; }
|
||||
|
||||
const clickOutsideEditTray = RED.settings.get("editor.view.click-outside-edit-tray", "save");
|
||||
if (clickOutsideEditTray !== "nothing") {
|
||||
const tray = stack[stack.length - 1];
|
||||
if (tray && clickOutsideEditTray === "discard") {
|
||||
RED.actions.invoke("core:cancel-edit-tray");
|
||||
} else if (tray && clickOutsideEditTray === "save") {
|
||||
if (tray.primaryButton) {
|
||||
tray.primaryButton.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
show: function show(options) {
|
||||
lowerTrayZ();
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ RED.userSettings = (function() {
|
|||
options: [
|
||||
{setting:"view-node-status",oldSetting:"menu-menu-item-status",label:"menu.label.displayStatus",default: true, toggle:true,onchange:"core:toggle-status"},
|
||||
{setting:"view-node-info-icon", label:"menu.label.displayInfoIcon", default: true, toggle:true,onchange:"core:toggle-node-info-icon"},
|
||||
{setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true}
|
||||
{setting:"view-node-show-label",label:"menu.label.showNodeLabelDefault",default: true, toggle:true},
|
||||
{ setting: "click-outside-edit-tray", label: "menu.label.clickOutsideEditTray", default: "nothing", options: (done) => done(["nothing", "discard", "save"].map((option) => ({ val: option, text: RED._("menu.label.clickOptions." + option) }))) }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue