Detect if a base_plain template was loaded via AJAX and refresh the screen to make it top level.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-04-08 02:29:45 -04:00
parent 12fce15d14
commit 2a61328e7b

View File

@@ -23,20 +23,30 @@
{% compress css %}
<link href="{% static 'appearance/vendors/fontawesome-free-5.0.8/svg-with-js/css/fa-svg-with-js.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/packages/bootswatch.com/flatly/bootstrap.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/bootswatch/flatly/bootstrap.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/css/base.css' %}" media="screen" rel="stylesheet" type="text/css" />
{% block stylesheets %}{% endblock %}
{% endcompress %}
<script>
function waitForJQuery(func) {
if (window.jQuery) {
func();
} else {
setTimeout(function() {
waitForJQuery(func)
}, 50);
{% compress js %}
// Detect if we are inside of an AJAX content container
// and break free as this is supposed to be a top level
// template.
var currentHash = window.location.hash;
if (currentHash.length) {
window.location = currentHash.substring(1);
}
}
function waitForJQuery(func) {
if (window.jQuery) {
func();
} else {
setTimeout(function() {
waitForJQuery(func)
}, 50);
}
}
{% endcompress %}
</script>
</head>
<body>
@@ -49,9 +59,9 @@
<![endif]-->
{% compress js %}
<script src="{% static 'appearance/packages/jquery-2.1.4.min.js' %}" type="text/javascript"></script>
<script src="{% static 'appearance/packages/bootstrap-3.3.4-dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
<script src="{% static 'appearance/vendors/fontawesome-free-5.0.8/svg-with-js/js/fontawesome-all.min.js' %}" type="text/javascript"></script>
<script src="{% static 'appearance/node_modules/jquery/dist/jquery.min.js' %}" type="text/javascript"></script>
<script src="{% static 'appearance/node_modules/bootstrap/dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
<script src="{% static 'appearance/vendors/fontawesome-free-5.0.8/svg-with-js/js/fontawesome-all.min.js' %}" type="text/javascript"></script>
{% endcompress %}
</body>
</html>