Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Merge requests
!1278
Resolve "Some legacy pages apparently get build up/rendered twice"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Some legacy pages apparently get build up/rendered twice"
841-some-legacy-pages-apparently-get-build-up-rendered-twice
into
master
Overview
0
Commits
1
Pipelines
3
Changes
2
Merged
Hangzhi Yu
requested to merge
841-some-legacy-pages-apparently-get-build-up-rendered-twice
into
master
1 year ago
Overview
0
Commits
1
Pipelines
3
Changes
2
Expand
Closes
#841 (closed)
0
0
Merge request reports
Compare
master
version 1
6a190d0a
1 year ago
master (base)
and
latest version
latest version
f6dd2828
1 commit,
1 year ago
version 1
6a190d0a
1 commit,
1 year ago
2 files
+
29
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
aleksis/core/frontend/components/LegacyBaseTemplate.vue
+
28
−
6
Options
@@ -21,7 +21,7 @@
</message-box>
<iframe
v-else
:src=
"
'/django' + $route.path + queryString
"
:src=
"
iFrameSrc
"
:height=
"iFrameHeight + 'px'"
class=
"iframe-fullsize"
@
load=
"load"
@@ -41,6 +41,7 @@ export default {
data
:
function
()
{
return
{
iFrameHeight
:
0
,
iFrameSrc
:
undefined
,
};
},
computed
:
{
@@ -53,13 +54,16 @@ export default {
},
},
methods
:
{
getIFrameURL
()
{
const
location
=
this
.
$refs
.
contentIFrame
.
contentWindow
.
location
;
const
url
=
new
URL
(
location
);
return
url
;
},
/** Handle iframe data after inner page loaded */
load
()
{
// Write new location of iframe back to Vue Router
const
location
=
this
.
$refs
.
contentIFrame
.
contentWindow
.
location
;
const
url
=
new
URL
(
location
);
const
path
=
url
.
pathname
.
replace
(
/^
\/
django/
,
""
);
const
pathWithQueryString
=
path
+
encodeURI
(
url
.
search
);
const
path
=
this
.
getIFrameURL
().
pathname
.
replace
(
/^
\/
django/
,
""
);
const
pathWithQueryString
=
path
+
encodeURI
(
this
.
getIFrameURL
().
search
);
const
routePath
=
path
.
charAt
(
path
.
length
-
1
)
===
"
/
"
&&
this
.
$route
.
path
.
charAt
(
path
.
length
-
1
)
!==
"
/
"
@@ -103,15 +107,33 @@ export default {
},
},
watch
:
{
$route
()
{
$route
(
newRoute
)
{
// Show loading animation once route changes
this
.
$root
.
contentLoading
=
true
;
// Only reload iFrame content when navigation comes from outsite the iFrame
const
path
=
this
.
getIFrameURL
().
pathname
.
replace
(
/^
\/
django/
,
""
);
const
routePath
=
path
.
charAt
(
path
.
length
-
1
)
===
"
/
"
&&
newRoute
.
path
.
charAt
(
path
.
length
-
1
)
!==
"
/
"
?
newRoute
.
path
+
"
/
"
:
newRoute
.
path
;
if
(
path
!==
routePath
)
{
this
.
$refs
.
contentIFrame
.
contentWindow
.
location
=
"
/django
"
+
this
.
$route
.
path
+
this
.
queryString
;
}
else
{
this
.
$root
.
contentLoading
=
false
;
}
// Scroll to top only when route changes to not affect form submits etc.
// A small duration to avoid flashing of the UI
this
.
$vuetify
.
goTo
(
0
,
{
duration
:
10
});
},
},
mounted
()
{
this
.
iFrameSrc
=
"
/django
"
+
this
.
$route
.
path
+
this
.
queryString
;
},
name
:
"
LegacyBaseTemplate
"
,
};
</
script
>
Loading