UI Landing: Simplify javascript code for overlay.
This commit is contained in:
@@ -150,12 +150,19 @@ link(href="{{ url_for('static_cloud', filename='assets/css/project-main.css') }}
|
|||||||
|
|
||||||
| {% block footer_scripts %}
|
| {% block footer_scripts %}
|
||||||
script.
|
script.
|
||||||
// Click anywhere in the page to hide the overlay
|
function showOverlay(html_content) {
|
||||||
function hideOverlay() {
|
$('#page-overlay')
|
||||||
$('#page-overlay.video').removeClass('active');
|
.addClass('active')
|
||||||
$('#page-overlay.video .video-embed').html('');
|
.html(html_content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideOverlay() {
|
||||||
|
$('#page-overlay')
|
||||||
|
.removeClass('active')
|
||||||
|
.html('');
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Click anywhere in the page to hide the overlay.
|
||||||
$(document).click(function () {
|
$(document).click(function () {
|
||||||
hideOverlay();
|
hideOverlay();
|
||||||
});
|
});
|
||||||
@@ -170,9 +177,8 @@ script.
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
$('#page-overlay').addClass('active');
|
|
||||||
var url = $(this).attr('href');
|
var url = $(this).attr('href');
|
||||||
$('#page-overlay').html('<img src="' + url + '"/>')
|
showOverlay('<img src="' + url + '"/>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user