mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add tooltips to outliner buttons
This commit is contained in:
parent
16a634063a
commit
565aae5967
@ -20,7 +20,9 @@
|
|||||||
"fill": "Fill",
|
"fill": "Fill",
|
||||||
"label": "Label",
|
"label": "Label",
|
||||||
"color": "Color",
|
"color": "Color",
|
||||||
"position": "Position"
|
"position": "Position",
|
||||||
|
"enable": "Enable",
|
||||||
|
"disable": "Disable"
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"string": "string",
|
"string": "string",
|
||||||
@ -595,7 +597,9 @@
|
|||||||
"showTips":"You can open the tips from the settings panel",
|
"showTips":"You can open the tips from the settings panel",
|
||||||
"outline": "Outline",
|
"outline": "Outline",
|
||||||
"empty": "empty",
|
"empty": "empty",
|
||||||
"globalConfig": "Global Configuration Nodes"
|
"globalConfig": "Global Configuration Nodes",
|
||||||
|
"triggerAction": "Trigger action",
|
||||||
|
"find": "Find in workspace"
|
||||||
},
|
},
|
||||||
"help": {
|
"help": {
|
||||||
"name": "Help",
|
"name": "Help",
|
||||||
|
@ -135,11 +135,12 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
function addControls(n,div) {
|
function addControls(n,div) {
|
||||||
var controls = $('<div>',{class:"red-ui-info-outline-item-controls red-ui-info-outline-item-hover-controls"}).appendTo(div);
|
var controls = $('<div>',{class:"red-ui-info-outline-item-controls red-ui-info-outline-item-hover-controls"}).appendTo(div);
|
||||||
if (n._def.button) {
|
if (n._def.button) {
|
||||||
$('<button type="button" class="red-ui-info-outline-item-control-action red-ui-button red-ui-button-small"><i class="fa fa-toggle-right"></i></button>').appendTo(controls).on("click",function(evt) {
|
var triggerButton = $('<button type="button" class="red-ui-info-outline-item-control-action red-ui-button red-ui-button-small"><i class="fa fa-toggle-right"></i></button>').appendTo(controls).on("click",function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
RED.view.clickNodeButton(n);
|
RED.view.clickNodeButton(n);
|
||||||
})
|
})
|
||||||
|
RED.popover.tooltip(triggerButton,RED._("sidebar.info.triggerAction"));
|
||||||
}
|
}
|
||||||
// $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-eye"></i></button>').appendTo(controls).on("click",function(evt) {
|
// $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-eye"></i></button>').appendTo(controls).on("click",function(evt) {
|
||||||
// evt.preventDefault();
|
// evt.preventDefault();
|
||||||
@ -147,7 +148,7 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
// RED.view.reveal(n.id);
|
// RED.view.reveal(n.id);
|
||||||
// })
|
// })
|
||||||
if (n.type !== 'group' && n.type !== 'subflow') {
|
if (n.type !== 'group' && n.type !== 'subflow') {
|
||||||
$('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
|
var toggleButton = $('<button type="button" class="red-ui-info-outline-item-control-disable red-ui-button red-ui-button-small"><i class="fa fa-circle-thin"></i><i class="fa fa-ban"></i></button>').appendTo(controls).on("click",function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
if (n.type === 'tab') {
|
if (n.type === 'tab') {
|
||||||
@ -179,6 +180,9 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
RED.view.redraw();
|
RED.view.redraw();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
RED.popover.tooltip(toggleButton,function() {
|
||||||
|
return RED._("common.label."+((n.type==='tab' && n.disabled) || (n.type!=='tab' && n.d))?"enable":"disable")
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
|
$('<div class="red-ui-info-outline-item-control-spacer">').appendTo(controls)
|
||||||
}
|
}
|
||||||
@ -401,11 +405,12 @@ RED.sidebar.info.outliner = (function() {
|
|||||||
}
|
}
|
||||||
function getGutter(n) {
|
function getGutter(n) {
|
||||||
var span = $("<span>",{class:"red-ui-info-outline-gutter"});
|
var span = $("<span>",{class:"red-ui-info-outline-gutter"});
|
||||||
$('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) {
|
var revealButton = $('<button type="button" class="red-ui-info-outline-item-control-reveal red-ui-button red-ui-button-small"><i class="fa fa-search"></i></button>').appendTo(span).on("click",function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
RED.view.reveal(n.id);
|
RED.view.reveal(n.id);
|
||||||
})
|
})
|
||||||
|
RED.popover.tooltip(revealButton,RED._("sidebar.info.find"));
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
function onNodeAdd(n) {
|
function onNodeAdd(n) {
|
||||||
|
Loading…
Reference in New Issue
Block a user