mirror of
https://github.com/wickedest/Mergely.git
synced 2026-04-25 12:08:34 +08:00
fix(#225): Fixes rendering issue when there are multiple editors
This commit is contained in:
committed by
GitHub
parent
aa496078fd
commit
1a2ee6af3d
@@ -318,7 +318,7 @@ CodeMirrorDiffView.prototype.bind = function(container) {
|
|||||||
if (!notice) {
|
if (!notice) {
|
||||||
notice = noticeTypes.lgpl;
|
notice = noticeTypes.lgpl;
|
||||||
}
|
}
|
||||||
const editor = this._queryElement(`#${this.id}`);
|
const editor = this.el;
|
||||||
const splash = dom.getSplash({
|
const splash = dom.getSplash({
|
||||||
notice,
|
notice,
|
||||||
left: (editor.offsetWidth - 300) / 2,
|
left: (editor.offsetWidth - 300) / 2,
|
||||||
@@ -1200,7 +1200,7 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) {
|
|||||||
|
|
||||||
CodeMirrorDiffView.prototype._queryElement = function(selector) {
|
CodeMirrorDiffView.prototype._queryElement = function(selector) {
|
||||||
const cacheName = `_element:${selector}`;
|
const cacheName = `_element:${selector}`;
|
||||||
const element = this[cacheName] || document.querySelector(selector);
|
const element = this[cacheName] || this.el.querySelector(selector);
|
||||||
if (!this[cacheName]) {
|
if (!this[cacheName]) {
|
||||||
this[cacheName] = element;
|
this[cacheName] = element;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user