--- a/svghmi/gen_index_xhtml.xslt Wed Mar 17 11:07:29 2021 +0100
+++ b/svghmi/gen_index_xhtml.xslt Thu Mar 18 14:32:21 2021 +0100
@@ -4607,50 +4607,56 @@
<xsl:text> this.abort_controller = new AbortController();
- <xsl:text> const query = {
- <xsl:text> args: this.args,
- <xsl:text> range: this.cache[1],
- <xsl:text> position: this.cache[2],
- <xsl:text> visible: this.visible,
- <xsl:text> extra: this.cache.slice(4),
- <xsl:text> options: opt
- <xsl:text> const options = {
- <xsl:text> method: 'POST',
- <xsl:text> body: JSON.stringify(query),
- <xsl:text> headers: {'Content-Type': 'application/json'},
- <xsl:text> signal: this.abort_controller.signal
- <xsl:text> return fetch(this.args[0], options)
- <xsl:text> .then(this.handle_http_response_bound)
- <xsl:text> .then(this.spread_json_data_bound)
- <xsl:text> .catch(this.fetch_error_bound);
+ <xsl:text> return Promise.resolve().then(() => { + <xsl:text> const query = { + <xsl:text> args: this.args, + <xsl:text> range: this.cache[1], + <xsl:text> position: this.cache[2], + <xsl:text> visible: this.visible, + <xsl:text> extra: this.cache.slice(4), + <xsl:text> options: opt + <xsl:text> const options = { + <xsl:text> method: 'POST', + <xsl:text> body: JSON.stringify(query), + <xsl:text> headers: {'Content-Type': 'application/json'}, + <xsl:text> signal: this.abort_controller.signal + <xsl:text> return fetch(this.args[0], options) + <xsl:text> .then(this.handle_http_response_bound) + <xsl:text> .then(this.spread_json_data_bound) + <xsl:text> .catch(this.fetch_error_bound); <xsl:text> this.abort_controller.abort();
--- a/svghmi/widget_jsontable.ysl2 Wed Mar 17 11:07:29 2021 +0100
+++ b/svghmi/widget_jsontable.ysl2 Thu Mar 18 14:32:21 2021 +0100
@@ -25,28 +25,31 @@
do_http_request(...opt) {
this.abort_controller = new AbortController();
- position: this.cache[2],
- extra: this.cache.slice(4),
+ return Promise.resolve().then(() => { + position: this.cache[2], + extra: this.cache.slice(4),
- body: JSON.stringify(query),
- headers: {'Content-Type': 'application/json'},
- signal: this.abort_controller.signal
+ body: JSON.stringify(query), + headers: {'Content-Type': 'application/json'}, + signal: this.abort_controller.signal - return fetch(this.args[0], options)
- .then(this.handle_http_response_bound)
- .then(this.spread_json_data_bound)
- .catch(this.fetch_error_bound);
+ return fetch(this.args[0], options) + .then(this.handle_http_response_bound) + .then(this.spread_json_data_bound) + .catch(this.fetch_error_bound);
this.abort_controller.abort();