Skip to content

Commit

Permalink
prettier lint test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
seirani authored and jtpio committed May 4, 2023
1 parent fd27d16 commit 7260268
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions packages/application/src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
this.layout = rootLayout;

// Added Skip to Main Link
const skipLinkWidgetHandler = (this._skipLinkWidgetHandler = new Private.SkipLinkWidgetHandler(
this
));
const skipLinkWidgetHandler = (this._skipLinkWidgetHandler =
new Private.SkipLinkWidgetHandler(this));

this.add(skipLinkWidgetHandler.skipLinkWidget, 'top', { rank: 0 });
this._skipLinkWidgetHandler.show();
Expand Down Expand Up @@ -374,37 +373,35 @@ export namespace Shell {
export type Area = 'main' | 'top' | 'left' | 'right' | 'menu';
}


export namespace Private {

export class SkipLinkWidgetHandler {
/**
* Construct a new skipLink widget handler.
*/
constructor(shell: INotebookShell) {
const skipLinkWidget = (this._skipLinkWidget = new Widget());
const skipToMain = document.createElement('a');
skipToMain.href = '#first-cell';
skipToMain.tabIndex = 1;
skipToMain.text = 'Skip to Main';
skipToMain.className = 'skip-link';
skipToMain.addEventListener('click', this);
skipLinkWidget.addClass('jp-skiplink');
skipLinkWidget.id = 'jp-skiplink';
skipLinkWidget.node.appendChild(skipToMain);
}
/**
* Construct a new skipLink widget handler.
*/
constructor(shell: INotebookShell) {
const skipLinkWidget = (this._skipLinkWidget = new Widget());
const skipToMain = document.createElement('a');
skipToMain.href = '#first-cell';
skipToMain.tabIndex = 1;
skipToMain.text = 'Skip to Main';
skipToMain.className = 'skip-link';
skipToMain.addEventListener('click', this);
skipLinkWidget.addClass('jp-skiplink');
skipLinkWidget.id = 'jp-skiplink';
skipLinkWidget.node.appendChild(skipToMain);
}

handleEvent(event: Event): void {
switch (event.type) {
case 'click':
this._focusMain();
break;
handleEvent(event: Event): void {
switch (event.type) {
case 'click':
this._focusMain();
break;
}
}
}

private _focusMain() {
const input = document.querySelector(
'#main-panel .jp-InputArea-editor'
private _focusMain() {
const input = document.querySelector(
'#main-panel .jp-InputArea-editor'
) as HTMLInputElement;
input.tabIndex = 1;
input.focus();
Expand Down

0 comments on commit 7260268

Please sign in to comment.