add `Shift-Tab` option for `Ctrl-E` modals inside apps

This commit is contained in:
daria 2024-09-09 14:22:18 +03:00
parent 9c506a52bb
commit 864c52e4f0
1 changed files with 13 additions and 1 deletions

View File

@ -2510,6 +2510,14 @@ define([
});
var selected = -1;
var previous = function () {
selected = (selected === 0 ? types.length : selected) - 1;
$container.find('.cp-icons-element-selected').removeClass('cp-icons-element-selected');
let element = $container.find('#cp-newpad-icons-'+selected).addClass('cp-icons-element-selected');
if (element.hasClass('cp-app-disabled')) {
previous();
}
};
var next = function () {
selected = ++selected % types.length;
$container.find('.cp-icons-element-selected').removeClass('cp-icons-element-selected');
@ -2524,7 +2532,11 @@ define([
if (e.which === 9) {
e.preventDefault();
e.stopPropagation();
next();
if (e.shiftKey) {
previous();
} else {
next();
}
return;
}
if (e.which === 13) {