mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Make color/icon/label-pos pickers keyboard navigable
This commit is contained in:
parent
68d3cc7507
commit
c9069d472f
@ -73,7 +73,7 @@ RED.colorPicker = (function() {
|
||||
type:"text",
|
||||
value:colorHiddenInput.val()
|
||||
}).appendTo(row);
|
||||
|
||||
var focusTarget = colorInput;
|
||||
colorInput.on("change", function (e) {
|
||||
var color = colorInput.val();
|
||||
colorHiddenInput.val(color).trigger('change');
|
||||
@ -188,8 +188,14 @@ RED.colorPicker = (function() {
|
||||
refreshDisplay(colorHiddenInput.val())
|
||||
},50);
|
||||
colorPanel.show({
|
||||
target: colorButton
|
||||
target: colorButton,
|
||||
onclose: function() {
|
||||
colorButton.focus();
|
||||
}
|
||||
})
|
||||
if (focusTarget) {
|
||||
focusTarget.focus();
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
refreshDisplay(colorHiddenInput.val())
|
||||
|
@ -366,6 +366,7 @@ RED.popover = (function() {
|
||||
|
||||
function hide(dispose) {
|
||||
$(document).off("mousedown.red-ui-popover-panel-close");
|
||||
$(document).off("keydown.red-ui-popover-panel-close");
|
||||
panel.hide();
|
||||
panel.css({
|
||||
height: "auto"
|
||||
@ -407,6 +408,16 @@ RED.popover = (function() {
|
||||
}
|
||||
panel.slideDown(100);
|
||||
|
||||
$(document).on("keydown.red-ui-popover-panel-close", function(event) {
|
||||
if (event.keyCode === 27) {
|
||||
// ESCAPE
|
||||
if (closeCallback) {
|
||||
closeCallback();
|
||||
}
|
||||
hide(options.dispose);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("mousedown.red-ui-popover-panel-close", function(event) {
|
||||
if(!$(event.target).closest(panel).length && !$(event.target).closest(".red-ui-editor-dialog").length) {
|
||||
if (closeCallback) {
|
||||
|
@ -410,7 +410,7 @@ button.red-ui-button.red-ui-editor-node-appearance-button {
|
||||
|
||||
.red-ui-group-layout-picker {
|
||||
padding: 5px;
|
||||
background: $primary-background;
|
||||
background: $secondary-background;
|
||||
}
|
||||
.red-ui-group-layout-picker-cell-text {
|
||||
position: absolute;
|
||||
|
Loading…
Reference in New Issue
Block a user