-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,438 additions
and
1,424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
Oops, something went wrong.