Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
3d893fa4
Commit
3d893fa4
authored
8 years ago
by
Guillaume Delhumeau
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-13778: Improve the loading time when a user opens a Flamingo Theme in edit mode.
parent
d3b82f14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-themes/xwiki-platform-flamingo-theme-ui/src/main/resources/FlamingoThemesCode/ThemeSheet.xml
+9
-5
9 additions, 5 deletions
...e-ui/src/main/resources/FlamingoThemesCode/ThemeSheet.xml
with
9 additions
and
5 deletions
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-themes/xwiki-platform-flamingo-theme-ui/src/main/resources/FlamingoThemesCode/ThemeSheet.xml
+
9
−
5
View file @
3d893fa4
...
...
@@ -362,9 +362,14 @@
// Put a gray curtain in front of the iframe
var addCurtain = function() {
var iframePosition = iframe.position();
$("
<
div id=\"preview-curtain\"
><
h2
>
$services.localization.render('platform.flamingo.themes.loading')
<
/h2
><
/div
>
").insertAfter(iframe);
var previewCurtain = $("#preview-curtain");
if (previewCurtain.length
>
0) {
// The curtain already exist, do nothing.
return;
}
var iframePosition = iframe.position();
previewCurtain = $("
<
div id=\"preview-curtain\"
><
h2
>
$services.localization.render('platform.flamingo.themes.loading')
<
/h2
><
/div
>
");
previewCurtain.insertAfter(iframe);
previewCurtain.width(iframe.outerWidth(true));
previewCurtain.height(iframe.outerHeight(true));
previewCurtain.css("left", iframePosition.left);
...
...
@@ -501,7 +506,6 @@
// 3: Refresh the live preview
waitUntilLessIsLoadedInIFrame(function(){
removeCurtain();
// We need to refresh just after LESS is loaded because the fist rendering does not handle the variables of the
// flamingo theme. Unfortunately, it means that the preview is rendered twice at the loading of the page.
// We refresh it in a thread to avoid blocking the browser.
...
...
@@ -509,8 +513,8 @@
});
};
//
Initialize the iframe
waitUntilIFrameIsLoaded(initIframe);
//
Add the curtain which will be removed when the iframe will be loaded and the LESS code compiled
addCurtain()
// The user can navigate to an other page inside the iframe, so when the page changes (onload),
// we re-init the iframe to use LESS
iframe.load(initIframe);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment