mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add delete button to tab edit dialog
This commit is contained in:
parent
9c72b65611
commit
419b044a12
@ -38,7 +38,6 @@ RED.sidebar = function() {
|
|||||||
content.style.paddingRight = "4px";
|
content.style.paddingRight = "4px";
|
||||||
|
|
||||||
addTab("info",content);
|
addTab("info",content);
|
||||||
sidebar_tabs.activateTab("tab-info");
|
|
||||||
|
|
||||||
$('#btn-sidebar').click(function() {toggleSidebar();});
|
$('#btn-sidebar').click(function() {toggleSidebar();});
|
||||||
RED.keyboard.add(/* SPACE */ 32,{ctrl:true},function(){toggleSidebar();d3.event.preventDefault();});
|
RED.keyboard.add(/* SPACE */ 32,{ctrl:true},function(){toggleSidebar();d3.event.preventDefault();});
|
||||||
|
@ -108,11 +108,15 @@ RED.view = function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#btn-workspace-delete').on("click",function() {
|
$('#btn-workspace-delete').on("click",function() {
|
||||||
var ws = RED.nodes.workspace(activeWorkspace);
|
deleteWorkspace(activeWorkspace);
|
||||||
|
});
|
||||||
|
|
||||||
|
function deleteWorkspace(id) {
|
||||||
|
var ws = RED.nodes.workspace(id);
|
||||||
$( "#node-dialog-delete-workspace" ).dialog('option','workspace',ws);
|
$( "#node-dialog-delete-workspace" ).dialog('option','workspace',ws);
|
||||||
$( "#node-dialog-delete-workspace-name" ).text(ws.label);
|
$( "#node-dialog-delete-workspace-name" ).text(ws.label);
|
||||||
$( "#node-dialog-delete-workspace" ).dialog('open');
|
$( "#node-dialog-delete-workspace" ).dialog('open');
|
||||||
});
|
}
|
||||||
|
|
||||||
//d3.select(window).on("keydown", keydown);
|
//d3.select(window).on("keydown", keydown);
|
||||||
|
|
||||||
@ -1016,6 +1020,15 @@ RED.view = function() {
|
|||||||
width: 500,
|
width: 500,
|
||||||
title: "Rename workspace",
|
title: "Rename workspace",
|
||||||
buttons: [
|
buttons: [
|
||||||
|
{
|
||||||
|
class: 'leftButton',
|
||||||
|
text: "Delete",
|
||||||
|
click: function() {
|
||||||
|
var workspace = $(this).dialog('option','workspace');
|
||||||
|
$( this ).dialog( "close" );
|
||||||
|
deleteWorkspace(workspace.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: "Ok",
|
text: "Ok",
|
||||||
click: function() {
|
click: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user