Commit b0392f9c authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs: Handle editor gadget iframe timeout error

It allows to not cancel the loading of the iframe and to prepare the appcache.
The former behavior removed the iframe thus interrupting the preparation of
the appcache.
parent b78a536d
...@@ -146,6 +146,23 @@ ...@@ -146,6 +146,23 @@
.push(function () { .push(function () {
return text_gadget.getElement(); return text_gadget.getElement();
}) })
.fail(function (error) {
var display_error_element;
if (error === "Timed out after 5000 ms") {
display_error_element =
gadget.props.element.querySelector(
"form div.ui-field-contain fieldset"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>';
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
" currently being cached, please wait for the page to load" +
" (check your browser loading icon) and then refresh.";
} else {
throw error;
}
});
}) })
///////////////////////////////////////// /////////////////////////////////////////
......
...@@ -146,6 +146,23 @@ ...@@ -146,6 +146,23 @@
}) })
.push(function () { .push(function () {
return text_gadget.getElement(); return text_gadget.getElement();
})
.fail(function (error) {
var display_error_element;
if (error === "Timed out after 5000 ms") {
display_error_element =
gadget.props.element.querySelector(
"form div.ui-field-contain fieldset"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>';
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
" currently being cached, please wait for the page to load" +
" (check your browser loading icon) and then refresh.";
} else {
throw error;
}
}); });
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment