mirror of
https://github.com/wickedest/Mergely.git
synced 2026-03-24 09:48:39 +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) {
|
||||
notice = noticeTypes.lgpl;
|
||||
}
|
||||
const editor = this._queryElement(`#${this.id}`);
|
||||
const editor = this.el;
|
||||
const splash = dom.getSplash({
|
||||
notice,
|
||||
left: (editor.offsetWidth - 300) / 2,
|
||||
@@ -1200,7 +1200,7 @@ CodeMirrorDiffView.prototype._renderDiff = function(changes) {
|
||||
|
||||
CodeMirrorDiffView.prototype._queryElement = function(selector) {
|
||||
const cacheName = `_element:${selector}`;
|
||||
const element = this[cacheName] || document.querySelector(selector);
|
||||
const element = this[cacheName] || this.el.querySelector(selector);
|
||||
if (!this[cacheName]) {
|
||||
this[cacheName] = element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user