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

[Improvements] ESLint action #1099

Merged
merged 7 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix
  • Loading branch information
neSpecc committed Apr 11, 2020
commit 45baafb04494d4c3ceee221cc2e456b54d1d8ca7
52 changes: 19 additions & 33 deletions src/components/modules/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,39 +529,25 @@ export default class Caret extends Module {
selection.addRange(newRange);
}

//
// Get all first-level (first child of [contenteditabel]) siblings from passed node
// Then you can check it for emptiness
//
// @example
// <div contenteditable>
// <p></p> |
// <p></p> | left first-level siblings
// <p></p> |
// <blockquote><a><b>adaddad</b><a><blockquote> <-- passed node for example <b>
// <p></p> |
// <p></p> | right first-level siblings
// <p></p> |
// </div>
// @return {Element[]}
// @param from
// @param direction
//
private getHigherLevelSiblings/**
*
*//**
*
*//**
*
*//**
*
*//**
*
*//**
*
*//**
*
*/(from: HTMLElement, direction?: string): HTMLElement[] {
/**
* Get all first-level (first child of [contenteditabel]) siblings from passed node
* Then you can check it for emptiness
*
* @example
* <div contenteditable>
* <p></p> |
* <p></p> | left first-level siblings
* <p></p> |
* <blockquote><a><b>adaddad</b><a><blockquote> <-- passed node for example <b>
* <p></p> |
* <p></p> | right first-level siblings
* <p></p> |
* </div>
* @returns {Element[]}
* @param from
* @param direction
*/
private getHigherLevelSiblings(from: HTMLElement, direction?: string): HTMLElement[] {
let current = from;
const siblings = [];

Expand Down
30 changes: 8 additions & 22 deletions src/components/modules/sanitizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,28 +181,14 @@ export default class Sanitizer extends Module {
return toolConfig;
}

//
// Returns Sanitizer config
// When Tool's "inlineToolbar" value is True, get all sanitizer rules from all tools,
// otherwise get only enabled
//
// @param name
//
public getInlineToolsConfig/**
*
*//**
*
*//**
*
*//**
*
*//**
*
*//**
*
*//**
*
*/(name: string): SanitizerConfig {
/**
* Returns Sanitizer config
* When Tool's "inlineToolbar" value is True, get all sanitizer rules from all tools,
* otherwise get only enabled
*
* @param name
*/
public getInlineToolsConfig(name: string): SanitizerConfig {
const { Tools } = this.Editor;
const toolsConfig = Tools.getToolSettings(name);
const enableInlineTools = toolsConfig.inlineToolbar || [];
Expand Down