Skip to content

Commit

Permalink
♻️ #13 toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 17, 2019
1 parent b2cd6f4 commit c1e39c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ts/toolbar/Headings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class Headings extends MenuItemClass {
})

for (let i = 0; i < 6; i++) {
headingsPanelElement.children.item(i).addEventListener('click', (event: any) => {
insertText(vditor.editor.element, event.target.getAttribute('data-value'), '')
headingsPanelElement.children.item(i).addEventListener('click', (event: Event) => {
insertText(vditor.editor.element, (<HTMLElement>event.target).getAttribute('data-value'), '')
headingsPanelElement.style.display = 'none'
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/ts/toolbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {Record} from "./Record";
import {Info} from "./Info";

export class Toolbar {
elements: any
elements: { [key: string]: HTMLElement }

constructor(vditor: Vditor) {
const options = vditor.options
Expand Down
2 changes: 1 addition & 1 deletion src/ts/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ interface Vditor {
mdTimeoutId: number
options: Options
toolbar?: {
elements?: { [key: string]: HTMLDivElement }
elements?: { [key: string]: HTMLElement }
}
preview?: {
element: HTMLElement
Expand Down

0 comments on commit c1e39c6

Please sign in to comment.