Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
e218736 committed Jan 2, 2024
1 parent ebc9057 commit 0da3605
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions packages/widgets/src/commandpalette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,8 @@ export class CommandPalette extends Widget {
* @returns The command items added to the palette.
*/
addItems(items: CommandPalette.IItemOptions[]): CommandPalette.IItem[] {
const newItems = items.map((item) =>
Private.createItem(this.commands, item)
);
newItems.forEach((item) => this._items.push(item));
const newItems = items.map(item => Private.createItem(this.commands, item));
newItems.forEach(item => this._items.push(item));
this.refresh();
return newItems;
}
Expand Down Expand Up @@ -377,7 +375,7 @@ export class CommandPalette extends Widget {
}

// Find the index of the item which was clicked.
let index = ArrayExt.findFirstIndex(this.contentNode.children, (node) => {
let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {
return node.contains(event.target as HTMLElement);
});

Expand Down Expand Up @@ -1565,7 +1563,7 @@ namespace Private {
get keyBinding(): CommandRegistry.IKeyBinding | null {
let { command, args } = this;
return (
ArrayExt.findLastValue(this._commands.keyBindings, (kb) => {
ArrayExt.findLastValue(this._commands.keyBindings, kb => {
return kb.command === command && JSONExt.deepEqual(kb.args, args);
}) || null
);
Expand Down
4 changes: 2 additions & 2 deletions packages/widgets/src/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ export class Menu extends Widget {
*/
private _evtMouseMove(event: MouseEvent): void {
// Hit test the item nodes for the item under the mouse.
let index = ArrayExt.findFirstIndex(this.contentNode.children, (node) => {
let index = ArrayExt.findFirstIndex(this.contentNode.children, node => {
return ElementExt.hitTest(node, event.clientX, event.clientY);
});

Expand Down Expand Up @@ -1927,7 +1927,7 @@ namespace Private {
if (this.type === 'command') {
let { command, args } = this;
return (
ArrayExt.findLastValue(this._commands.keyBindings, (kb) => {
ArrayExt.findLastValue(this._commands.keyBindings, kb => {
return kb.command === command && JSONExt.deepEqual(kb.args, args);
}) || null
);
Expand Down

0 comments on commit 0da3605

Please sign in to comment.