Skip to content

Commit

Permalink
fix: use appendChild instead of append to adapt chrome version 53 and…
Browse files Browse the repository at this point in the history
… lower
  • Loading branch information
jiawei686 authored and lyngai committed Oct 28, 2022
1 parent 59cef79 commit a21925a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/core/hooks/Suggester.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class SuggesterPanel {
this.suggesterConfig = {};

if (!this.$suggesterPanel && isBrowser()) {
document.body.append(this.createDom(SuggesterPanel.panelWrap));
document.body.appendChild(this.createDom(SuggesterPanel.panelWrap));
this.$suggesterPanel = document.querySelector('.cherry-suggester-panel');
}
}
Expand Down Expand Up @@ -256,7 +256,7 @@ class SuggesterPanel {

showsuggesterPanel({ left, top, items }) {
if (!this.$suggesterPanel) {
document.body.append(this.createDom(SuggesterPanel.panelWrap));
document.body.appendChild(this.createDom(SuggesterPanel.panelWrap));
this.$suggesterPanel = document.querySelector('.cherry-suggester-panel');
}
this.updatePanel(items);
Expand All @@ -283,7 +283,7 @@ class SuggesterPanel {
if (typeof defaultValue === 'string') {
this.$suggesterPanel.innerHTML = defaultValue;
} else if (typeof defaultValue === 'object' && defaultValue.nodeType === 1) {
this.$suggesterPanel.append(defaultValue);
this.$suggesterPanel.appendChild(defaultValue);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/imgSizeHander.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const imgSizeHander = {
this.butsImg = document.createElement('div');
this.butsImg.className = 'cherry-previewer-img-size-hander__background';
this.butsImg.style.backgroundImage = `url(${this.buts.imgSrc})`;
this.butsLayout.append(this.butsImg);
this.butsLayout.appendChild(this.butsImg);

this.butsPoints = {};
Object.keys(this.buts.points.arr).forEach((index) => {
Expand All @@ -123,7 +123,7 @@ const imgSizeHander = {
`cherry-previewer-img-size-hander__points-${name}`,
].join(' ');
tmp.dataset.name = name;
this.butsLayout.append(tmp);
this.butsLayout.appendChild(tmp);
this.butsPoints[`pints-${name}`] = tmp;
});
return this.updateBubbleButs();
Expand Down
4 changes: 2 additions & 2 deletions src/utils/tableContentHander.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ const tableContentHander = {
const dom = document.createElement('div');
dom.className = 'cherry-previewer-table-content-hander__input';
const input = document.createElement('textarea');
dom.append(input);
dom.appendChild(input);
this.tableEditor.editorDom.inputDiv = dom;
this.tableEditor.editorDom.inputDom = input;
this.$updateEditorPosition();
this.container.append(this.tableEditor.editorDom.inputDiv);
this.container.appendChild(this.tableEditor.editorDom.inputDiv);
this.tableEditor.editorDom.inputDom.value = this.tableEditor.info.code.replace(/<br>/g, '\n');
this.tableEditor.editorDom.inputDom.focus();
},
Expand Down

0 comments on commit a21925a

Please sign in to comment.