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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
763cbce0
Commit
763cbce0
authored
Oct 03, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_js_style: hide the page until full rendering is done
parent
bd7a8fb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
...plateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
+27
-3
No files found.
bt5/erp5_web_js_style/SkinTemplateItem/portal_skins/erp5_web_js_style_ui/jsstyle.js.js
View file @
763cbce0
...
...
@@ -5,6 +5,16 @@
loopEventListener
,
history
,
console
)
{
"
use strict
"
;
function
hidePage
()
{
document
.
documentElement
.
hidden
=
true
;
document
.
documentElement
.
style
.
display
=
'
none
'
;
}
function
showPage
()
{
document
.
documentElement
.
hidden
=
false
;
document
.
documentElement
.
style
.
display
=
'
unset
'
;
}
// XXX Copy/paste from renderjs
function
ajax
(
url
)
{
var
xhr
;
...
...
@@ -386,7 +396,7 @@
rJS
(
window
)
.
allowPublicAcquisition
(
"
reportServiceError
"
,
function
()
{
this
.
element
.
hidden
=
false
;
showPage
()
;
throw
rJS
.
AcquisitionError
();
})
.
declareJob
(
"
listenURLChange
"
,
listenURLChange
)
...
...
@@ -426,10 +436,16 @@
gadget
.
listenURLChange
();
body
.
appendChild
(
style_gadget
.
element
);
gadget
.
element
.
hidden
=
false
;
// Show the page after the first rendering
// This prevent displaying the original HTML page
// in case cpu/network is too slow
showPage
();
scrollToHash
(
window
.
location
.
hash
);
},
function
(
error
)
{
gadget
.
element
.
hidden
=
false
;
// Ensure the page is visible in case of error
showPage
();
throw
error
;
});
},
function
(
error
)
{
...
...
@@ -448,5 +464,13 @@
});
});
// Hide the page as soon as possible
// This prevent displaying the original HTML page
// in case cpu/network is too slow
// (when fetching rendering gadget or if pages containes img elements)
// Hiding the page MUST NOT be done in the HTML, to ensure compatibility
// with browsers without javascript
hidePage
();
}(
window
,
document
,
RSVP
,
rJS
,
XMLHttpRequest
,
DOMParser
,
URL
,
rJS
.
loopEventListener
,
history
,
console
));
\ No newline at end of file
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