Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
b8730576
Commit
b8730576
authored
Jun 17, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "monaco_editor: abort pending checkPythonSourceCode requests"
This reverts commit
93d60201
.
parent
a1b8ee7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
26 deletions
+2
-26
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco_editor_support.zpt
...portal_skins/erp5_monaco_editor/monaco_editor_support.zpt
+2
-26
No files found.
bt5/erp5_monaco_editor/SkinTemplateItem/portal_skins/erp5_monaco_editor/monaco_editor_support.zpt
View file @
b8730576
...
@@ -107,22 +107,6 @@ $script.onload = function() {
...
@@ -107,22 +107,6 @@ $script.onload = function() {
}
}
var timeout = null;
var timeout = null;
// minimal pollyfil for AbortController
if (self.AbortController === undefined) {
class AbortController {
constructor() {
this.signal = { aborted: false };
}
abort() {
this.signal.aborted = true;
}
}
console.log("AbortController not available");
self.AbortController = AbortController;
}
var controller = new AbortController();
function checkPythonSourceCode() {
function checkPythonSourceCode() {
const data = new FormData();
const data = new FormData();
const checker_parameters = {
const checker_parameters = {
...
@@ -139,8 +123,7 @@ $script.onload = function() {
...
@@ -139,8 +123,7 @@ $script.onload = function() {
data.append("data", JSON.stringify(checker_parameters));
data.append("data", JSON.stringify(checker_parameters));
fetch(portal_url + "/ERP5Site_checkPythonSourceCodeAsJSON", {
fetch(portal_url + "/ERP5Site_checkPythonSourceCodeAsJSON", {
method: "POST",
method: "POST",
body: data,
body: data
signal: controller.signal
})
})
.then(response => response.json())
.then(response => response.json())
.then(data => {
.then(data => {
...
@@ -162,12 +145,7 @@ $script.onload = function() {
...
@@ -162,12 +145,7 @@ $script.onload = function() {
})
})
);
);
timeout = null;
timeout = null;
}, e => {
});
if (!e instanceof DOMException /* AbortError */ ) {
throw e;
}
/* ignore aborted requests */
});
}
}
editor.model.onDidChangeContent(event => {
editor.model.onDidChangeContent(event => {
...
@@ -175,8 +153,6 @@ $script.onload = function() {
...
@@ -175,8 +153,6 @@ $script.onload = function() {
changed = true; /* global variable used in erp5.js for onbeforeunload event */
changed = true; /* global variable used in erp5.js for onbeforeunload event */
if (mode == "python") {
if (mode == "python") {
// debounced `checkPythonSourceCode`
// debounced `checkPythonSourceCode`
controller.abort();
controller = new AbortController();
if (timeout) {
if (timeout) {
clearTimeout(timeout);
clearTimeout(timeout);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment