Browse Source

impl redirect para iframe incorreto (#2166)

pull/2163/head
Leandro Roberto da Silva 6 years ago
committed by Edward
parent
commit
ff2ae20d8b
  1. 13
      sapl/static/styles/app.scss
  2. 23
      sapl/templates/base.html

13
sapl/static/styles/app.scss

@ -558,6 +558,19 @@ p {
}
}
.btn-cancel-iframe {
position: relative;
text-align: right;
opacity: 0.5;
&:hover {
opacity: 1;
}
a {
padding: 10px;
display: inline-block;
}
}
@media (max-width: 1199px) {
.masthead {

23
sapl/templates/base.html

@ -29,6 +29,7 @@
<body>
<div class="page fadein">
{% if not request|has_iframe %}
{% block navigation %}
<nav class="navbar navbar-inverse navbar-static-top">
@ -108,6 +109,9 @@
</header>
{% endblock main_header %}
{% else %}
<div class="btn-cancel-iframe">
<a href="?iframe=0" target="_blank"><i class="fa fa-2x fa-arrows-alt"></i></a>
</div>
<header class="masthead">
<div class="container">
<div class="hidden-print">
@ -245,6 +249,25 @@
{% block extra_js %}{% endblock %}
<script type="text/javascript" >
function inIframe () {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
$(document).ready(function(){
let iframe_set_backend = {{ request|has_iframe|lower }}
if (iframe_set_backend && !inIframe() ) {
let href = location.href
location.href = href + '?iframe=0'
}
});
</script>
{% endblock foot_js %}
</body>
</html>

Loading…
Cancel
Save