Skip to content

Commit

Permalink
style: switch to standard
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisyip committed Aug 1, 2019
1 parent bac5999 commit 0afaac5
Show file tree
Hide file tree
Showing 44 changed files with 1,438 additions and 1,424 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
charset = utf-8

[*.{js,ts}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.{yml,toml}]
indent_style = space
indent_size = 2
34 changes: 17 additions & 17 deletions base.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
export default class CabinetBase {
protected rootDom: HTMLElement;
protected onSaveStatusChange: (status: ShimoSDK.Common.CollaborationStatus) => {};
protected rootDom: HTMLElement
protected onSaveStatusChange: (status: ShimoSDK.Common.CollaborationStatus) => {}

constructor(rootDom: HTMLElement, onSaveStatusChange: (status: ShimoSDK.Common.CollaborationStatus) => {}) {
this.rootDom = rootDom;
this.onSaveStatusChange = onSaveStatusChange;
}
constructor (rootDom: HTMLElement, onSaveStatusChange: (status: ShimoSDK.Common.CollaborationStatus) => {}) {
this.rootDom = rootDom
this.onSaveStatusChange = onSaveStatusChange
}

public getDom(domId: string, root?: HTMLElement, elementType = "div") {
let sdkDom = document.getElementById(domId);
if (!sdkDom) {
sdkDom = document.createElement(elementType);
sdkDom.setAttribute("id", domId);
root ? root.appendChild(sdkDom) : this.rootDom.appendChild(sdkDom);
}
return sdkDom;
public getDom (domId: string, root?: HTMLElement, elementType = 'div') {
let sdkDom = document.getElementById(domId)
if (!sdkDom) {
sdkDom = document.createElement(elementType)
sdkDom.setAttribute('id', domId)
root ? root.appendChild(sdkDom) : this.rootDom.appendChild(sdkDom)
}
return sdkDom
}

protected insertAfter(referenceNode: HTMLElement, newNode: HTMLElement) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
protected insertAfter (referenceNode: HTMLElement, newNode: HTMLElement) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)
}
}
Loading

0 comments on commit 0afaac5

Please sign in to comment.