1
0
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:
Nicholas O'Leary 2013-10-28 20:28:44 +00:00
parent 9c72b65611
commit 419b044a12
2 changed files with 15 additions and 3 deletions

View File

@ -38,7 +38,6 @@ RED.sidebar = function() {
content.style.paddingRight = "4px";
addTab("info",content);
sidebar_tabs.activateTab("tab-info");
$('#btn-sidebar').click(function() {toggleSidebar();});
RED.keyboard.add(/* SPACE */ 32,{ctrl:true},function(){toggleSidebar();d3.event.preventDefault();});

View File

@ -108,11 +108,15 @@ RED.view = 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-name" ).text(ws.label);
$( "#node-dialog-delete-workspace" ).dialog('open');
});
}
//d3.select(window).on("keydown", keydown);
@ -1016,6 +1020,15 @@ RED.view = function() {
width: 500,
title: "Rename workspace",
buttons: [
{
class: 'leftButton',
text: "Delete",
click: function() {
var workspace = $(this).dialog('option','workspace');
$( this ).dialog( "close" );
deleteWorkspace(workspace.id);
}
},
{
text: "Ok",
click: function() {