Skip to content

Commit

Permalink
lazy load 3rd party licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jun 18, 2019
1 parent 5e09260 commit f85efd2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion addon_files/redmatic/www/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,19 @@ $(document).ready(() => {
}

$('a[href="' + (location.hash || '#configuration') + '"]').tab('show');
if (location.hash === '#licenses' && !$('#licenses iframe').attr('src')) {
$('#licenses iframe').attr('src', 'licenses.html');
}

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
if(history.pushState) {
if (history.pushState) {
history.pushState(null, null, '#' + $(e.target).attr('href').substr(1));
} else {
location.hash = '#' + $(e.target).attr('href').substr(1);
}
if ($(e.target).attr('href') === '#licenses' && !$('#licenses iframe').attr('src')) {
$('#licenses iframe').attr('src', 'licenses.html');
}
});

let psTimeout;
Expand Down
2 changes: 1 addition & 1 deletion addon_files/redmatic/www/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
</div>

<div class="tab-pane fade show" id="licenses" role="tabpanel" aria-labelledby="licenses-tab">
<iframe src="licenses.html"></iframe>
<iframe></iframe>
</div>


Expand Down

0 comments on commit f85efd2

Please sign in to comment.