mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-22 21:51:50 +08:00
Ran eslint fix on existing codebase
Had to do some manual fixing of the app.js file due to misplaced comments
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import {Component} from "./component";
|
||||
import {Component} from './component';
|
||||
|
||||
function reverseMap(map) {
|
||||
const reversed = {};
|
||||
@ -8,7 +8,6 @@ function reverseMap(map) {
|
||||
return reversed;
|
||||
}
|
||||
|
||||
|
||||
export class Shortcuts extends Component {
|
||||
|
||||
setup() {
|
||||
@ -25,7 +24,6 @@ export class Shortcuts extends Component {
|
||||
|
||||
setupListeners() {
|
||||
window.addEventListener('keydown', event => {
|
||||
|
||||
if (event.target.closest('input, select, textarea')) {
|
||||
return;
|
||||
}
|
||||
@ -44,7 +42,6 @@ export class Shortcuts extends Component {
|
||||
* @param {KeyboardEvent} event
|
||||
*/
|
||||
handleShortcutPress(event) {
|
||||
|
||||
const keys = [
|
||||
event.ctrlKey ? 'Ctrl' : '',
|
||||
event.metaKey ? 'Cmd' : '',
|
||||
@ -90,7 +87,7 @@ export class Shortcuts extends Component {
|
||||
return true;
|
||||
}
|
||||
|
||||
console.error(`Shortcut attempted to be ran for element type that does not have handling setup`, el);
|
||||
console.error('Shortcut attempted to be ran for element type that does not have handling setup', el);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -135,10 +132,10 @@ export class Shortcuts extends Component {
|
||||
|
||||
const linkage = document.createElement('div');
|
||||
linkage.classList.add('shortcut-linkage');
|
||||
linkage.style.left = targetBounds.x + 'px';
|
||||
linkage.style.top = targetBounds.y + 'px';
|
||||
linkage.style.width = targetBounds.width + 'px';
|
||||
linkage.style.height = targetBounds.height + 'px';
|
||||
linkage.style.left = `${targetBounds.x}px`;
|
||||
linkage.style.top = `${targetBounds.y}px`;
|
||||
linkage.style.width = `${targetBounds.width}px`;
|
||||
linkage.style.height = `${targetBounds.height}px`;
|
||||
|
||||
wrapper.append(label, linkage);
|
||||
|
||||
@ -159,4 +156,5 @@ export class Shortcuts extends Component {
|
||||
|
||||
this.hintsShowing = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user