mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 09:03:36 -05:00
Merge pull request #6551 from overleaf/bg-remove-unused-flag
[web] remove unused keepEditorContents flag GitOrigin-RevId: 9c20469e9200ee9aad19fdd0d1567a6eea704741
This commit is contained in:
parent
74d9937816
commit
30cd3d2961
2 changed files with 7 additions and 9 deletions
|
@ -355,7 +355,7 @@ export default ShareJsDoc = (function () {
|
|||
|
||||
attachToAce(ace) {
|
||||
this._attachToEditor('Ace', ace, () => {
|
||||
this._doc.attach_ace(ace, false, window.maxDocLength)
|
||||
this._doc.attach_ace(ace, window.maxDocLength)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ export default ShareJsDoc = (function () {
|
|||
|
||||
attachToCM(cm) {
|
||||
this._attachToEditor('CM', cm, () => {
|
||||
this._doc.attach_cm(cm, false, window.maxDocLength)
|
||||
this._doc.attach_cm(cm, window.maxDocLength)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ export default ShareJsDoc = (function () {
|
|||
|
||||
attachToCM6(cm6) {
|
||||
this._attachToEditor('CM6', cm6, () => {
|
||||
cm6.attachShareJs(this._doc, false, window.maxDocLength)
|
||||
cm6.attachShareJs(this._doc, window.maxDocLength)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
10
services/web/frontend/js/vendor/libs/sharejs.js
vendored
10
services/web/frontend/js/vendor/libs/sharejs.js
vendored
|
@ -1467,9 +1467,8 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) {
|
|||
};
|
||||
|
||||
// Attach an ace editor to the document. The editor's contents are replaced
|
||||
// with the document's contents unless keepEditorContents is true. (In which case the document's
|
||||
// contents are nuked and replaced with the editor's).
|
||||
window.sharejs.extendDoc('attach_ace', function (editor, keepEditorContents, maxDocLength) {
|
||||
// with the document's contents.
|
||||
window.sharejs.extendDoc('attach_ace', function (editor, maxDocLength) {
|
||||
if (!this.provides['text']) {
|
||||
throw new Error('Only text documents can be attached to ace');
|
||||
}
|
||||
|
@ -1622,14 +1621,13 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) {
|
|||
};
|
||||
|
||||
// Attach a CodeMirror editor to the document. The editor's contents are replaced
|
||||
// with the document's contents unless keepEditorContents is true. (In which case
|
||||
// the document's contents are nuked and replaced with the editor's).
|
||||
// with the document's contents.
|
||||
// NOTE: When upgrading CM, make sure to check for new special cases of
|
||||
// origin prefixes as documented for `doc.setSelection`. We are using
|
||||
// a custom `origin: 'remote'` which may conflict.
|
||||
// Perma link of the docs at the time of writing this note:
|
||||
// https://web.archive.org/web/20201029163528/https://codemirror.net/doc/manual.html#selection_origin
|
||||
window.sharejs.extendDoc('attach_cm', function (editor, keepEditorContents, maxDocLength) {
|
||||
window.sharejs.extendDoc('attach_cm', function (editor, maxDocLength) {
|
||||
if (!this.provides.text) {
|
||||
throw new Error('Only text documents can be attached to CodeMirror2');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue