Make all dialog buttons consistent with editor tray

This commit is contained in:
Nick O'Leary 2016-05-03 21:36:22 +01:00
parent ce25fc658b
commit fa90eeac55
6 changed files with 79 additions and 41 deletions

View File

@ -23,7 +23,7 @@ RED.clipboard = (function() {
var importNodesDialog;
function setupDialogs() {
dialog = $('<div id="clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
dialog = $('<div id="clipboard-dialog" class="hide node-red-dialog"><form class="dialog-form form-horizontal"></form></div>')
.appendTo("body")
.dialog({
modal: true,
@ -31,14 +31,6 @@ RED.clipboard = (function() {
width: 500,
resizable: false,
buttons: [
{
id: "clipboard-dialog-ok",
text: RED._("common.label.ok"),
click: function() {
RED.view.importNodes($("#clipboard-import").val());
$( this ).dialog( "close" );
}
},
{
id: "clipboard-dialog-cancel",
text: RED._("common.label.cancel"),
@ -48,10 +40,20 @@ RED.clipboard = (function() {
},
{
id: "clipboard-dialog-close",
class: "primary",
text: RED._("common.label.close"),
click: function() {
$( this ).dialog( "close" );
}
},
{
id: "clipboard-dialog-ok",
class: "primary",
text: RED._("common.label.import"),
click: function() {
RED.view.importNodes($("#clipboard-import").val());
$( this ).dialog( "close" );
}
}
],
open: function(e) {

View File

@ -254,7 +254,14 @@ RED.library = (function() {
height: 450,
buttons: [
{
text: RED._("common.label.ok"),
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.load"),
class: "primary",
click: function() {
if (selectedLibraryItem) {
for (var i=0;i<options.fields.length;i++) {
@ -265,12 +272,6 @@ RED.library = (function() {
}
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
}
],
open: function(e) {
@ -359,15 +360,16 @@ RED.library = (function() {
height: 230,
buttons: [
{
text: RED._("common.label.ok"),
text: RED._("common.label.cancel"),
click: function() {
saveToLibrary(true);
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.cancel"),
text: RED._("common.label.save"),
class: "primary",
click: function() {
saveToLibrary(true);
$( this ).dialog( "close" );
}
}
@ -381,15 +383,16 @@ RED.library = (function() {
height: 230,
buttons: [
{
text: RED._("common.label.ok"),
text: RED._("common.label.cancel"),
click: function() {
saveToLibrary(false);
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.cancel"),
text: RED._("common.label.save"),
class: "primary",
click: function() {
saveToLibrary(false);
$( this ).dialog( "close" );
}
}
@ -432,9 +435,17 @@ RED.library = (function() {
resizable: false,
title: RED._("library.exportToLibrary"),
buttons: [
{
id: "library-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
id: "library-dialog-ok",
text: RED._("common.label.ok"),
class: "primary",
text: RED._("common.label.export"),
click: function() {
//TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val();
@ -457,13 +468,6 @@ RED.library = (function() {
}
$( this ).dialog( "close" );
}
},
{
id: "library-dialog-cancel",
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
}
],
open: function(e) {

View File

@ -134,7 +134,14 @@ RED.workspaces = (function() {
}
},
{
text: RED._("common.label.ok"),
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.done"),
class: "primary",
click: function() {
var workspace = $(this).dialog('option','workspace');
var label = $( "#node-input-workspace-name" ).val();
@ -146,13 +153,8 @@ RED.workspaces = (function() {
}
$( this ).dialog( "close" );
}
},
{
text: RED._("common.label.cancel"),
click: function() {
$( this ).dialog( "close" );
}
}
],
open: function(e) {
RED.keyboard.disable();

View File

@ -71,7 +71,8 @@
button {
@include workspace-button;
padding: 0.4em 1em;
font-size: 14px;
padding: 6px 14px;
margin-right: 8px;
color: $editor-button-color-primary;
&.leftButton {
@ -83,7 +84,6 @@
}
&:not(.primary) {
background: none;
&:hover {
color: $editor-button-color-primary;
}

View File

@ -73,6 +73,32 @@
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: none;
}
.ui-dialog-buttonset button {
@include workspace-button;
font-size: 14px;
padding: 6px 14px;
margin-right: 8px;
color: $editor-button-color-primary;
&.leftButton {
float: left;
margin-top: 7px;
}
&:not(.leftButton):not(:last-child) {
margin-right: 16px;
}
&:not(.primary) {
background: none;
&:hover {
color: $editor-button-color-primary;
}
}
.ui-button-text {
padding: 0;
}
}
.ui-dialog .ui-dialog-buttonpane {
padding: .3em 1em .5em 1em;
}

View File

@ -6,7 +6,11 @@
"done":"Done",
"cancel": "Cancel",
"delete": "Delete",
"close": "Close"
"close": "Close",
"load": "Load",
"save": "Save",
"import": "Import",
"export": "Export"
}
},
"workspace": {
@ -196,7 +200,7 @@
},
"sidebar": {
"info": {
"name": "Information",
"name": "Node information",
"label": "info",
"node": "Node",
"type": "Type",