Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #10297 8.14-RC - A few areas where focus lock doesn't work prop… #10331

Merged
merged 1 commit into from
May 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
var isLeftColumnAbove = false;
scope.editors = [];

/* we need to keep a count of open editors because the length of the editors array is first changed when animations are done
we do this because some infinite editors close more than one editor at the time and we get the wrong count from editors.length
because of the animation */
let editorCount = 0;

function addEditor(editor) {
editor.inFront = true;
editor.moveRight = true;
Expand Down Expand Up @@ -51,13 +56,16 @@

updateEditors(-1);

if(scope.editors.length === 1){
if(scope.editors.length === 1) {
if(isLeftColumnAbove){
$('#leftcolumn').addClass(aboveBackDropCssClass);
}

isLeftColumnAbove = false;
}

// when the last editor is closed remove the focus lock
if (editorCount === 0) {
// Remove the inert attribute from the #mainwrapper
focusLockService.removeInertAttribute();
}
Expand Down Expand Up @@ -105,16 +113,19 @@
}

evts.push(eventsService.on("appState.editors.open", function (name, args) {
editorCount = editorCount + 1;
addEditor(args.editor);
}));

evts.push(eventsService.on("appState.editors.close", function (name, args) {
// remove the closed editor
if (args && args.editor) {
editorCount = editorCount - 1;
removeEditor(args.editor);
}
// close all editors
if (args && !args.editor && args.editors.length === 0) {
editorCount = 0;
scope.editors = [];
}
}));
Expand Down