Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pascal MOLIN
lektor-admin-extra
Commits
794f8ec0
Commit
794f8ec0
authored
Jan 12, 2021
by
Pascal
Browse files
fix remove inner buttons
parent
9fd33fcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/admin_buttons.html
View file @
794f8ec0
...
@@ -5,13 +5,16 @@
...
@@ -5,13 +5,16 @@
</div>
</div>
{# FIXME: try to remove buttons inside preview iframe... #}
{# FIXME: try to remove buttons inside preview iframe... #}
<script>
<script>
document
.
querySelector
(
"
iframe
"
).
addEventListener
(
"
load
"
,
function
(
e
)
{
/* https://stackoverflow.com/questions/326069 */
return
;
function
inIframe
()
{
var
iframe
=
document
.
querySelector
(
"
iframe
"
);
try
{
var
inner
=
iframe
.
contentDocument
||
iframe
.
contentWindow
.
document
;
return
window
.
self
!==
window
.
top
;
var
divs
=
inner
.
getElementsByClassName
(
'
auth-button-div
'
);
}
catch
(
e
)
{
return
true
;
}
}
if
(
inIframe
())
{
var
divs
=
document
.
getElementsByClassName
(
'
auth-button-div
'
);
if
(
divs
)
divs
[
0
].
parentNode
.
removeChild
(
divs
[
0
]);
if
(
divs
)
divs
[
0
].
parentNode
.
removeChild
(
divs
[
0
]);
//var divs = inner.getElementsByClassName('auth-flashes');
}
//if (divs) divs[0].parentNode.removeChild(divs[0]);
});
</script>
</script>
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