Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
6faf33c4
Commit
6faf33c4
authored
7 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-2976: fix the loop around the anchors in iframe for the workaround for FireFox
parent
e3aa9331
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
src/main/webapp/static/js/openolat/iframe.js
+23
-21
23 additions, 21 deletions
src/main/webapp/static/js/openolat/iframe.js
with
23 additions
and
21 deletions
src/main/webapp/static/js/openolat/iframe.js
+
23
−
21
View file @
6faf33c4
...
...
@@ -178,7 +178,7 @@ function b_sendNewUriEventToParent() {
}
function
b_addOnloadEvent
(
fnc
){
//console.log("b_addOnloadEvent window.name=" + window.name + " b_iframeid=" + b_iframeid + " fnc=" + fnc);
//console.log("b_addOnloadEvent window.name=" + window.name + " b_iframeid=" + b_iframeid + " fnc=" + fnc);
try
{
// Only continue if we can locate the main window
var
mainwindow
=
b_getMainWindow
(
window
.
parent
);
...
...
@@ -211,29 +211,31 @@ function b_anchorFirefoxWorkaround() {
var
anchors
=
document
.
getElementsByTagName
(
'
a
'
);
for
(
var
i
=
0
;
i
<
anchors
.
length
;
i
++
)
{
var
anchor
=
anchors
[
i
];
var
href
=
anchor
.
getAttribute
(
'
href
'
);
if
(
href
&&
href
[
0
]
==
"
#
"
)
{
var
name
=
href
.
substring
(
1
);
anchor
.
addEventListener
(
'
click
'
,
function
()
{
try
{
var
nameElement
=
document
.
getElementsByName
(
name
);
var
element
=
null
;
if
(
nameElement
!=
null
&&
nameElement
.
length
>
0
)
{
var
href
=
anchor
.
getAttribute
(
'
href
'
);
if
(
href
&&
href
[
0
]
==
"
#
"
)
{
anchor
.
addEventListener
(
'
click
'
,
function
(
el
)
{
try
{
var
href
=
el
.
target
.
getAttribute
(
'
href
'
);
var
name
=
href
.
substring
(
1
);
var
nameElement
=
document
.
getElementsByName
(
name
);
var
element
=
null
;
if
(
nameElement
!=
null
&&
nameElement
.
length
>
0
)
{
element
=
nameElement
[
0
];
}
else
{
var
idElement
=
document
.
getElementById
(
name
);
if
(
idElement
!=
null
)
{
element
=
idElement
;
}
}
if
(
element
&&
window
&&
window
.
parent
)
{
}
else
{
var
idElement
=
document
.
getElementById
(
name
);
if
(
idElement
!=
null
)
{
element
=
idElement
;
}
}
if
(
element
&&
window
&&
window
.
parent
)
{
var
offset
=
b_anchorFirefoxWorkaroundCumulativeOffset
(
element
);
window
.
parent
.
scrollTo
(
offset
[
0
],
offset
[
1
]);
}
}
catch
(
e
)
{
//console.log(e);
}
return
true
;
}
}
catch
(
e
)
{
//console.log(e);
}
return
true
;
});
}
}
...
...
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