Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions public/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ function displayCell(int $value): string
}
?>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>


<script>
$(function () {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore jQuery UI before billing datepicker init

billing.php still calls $("#datepicker, #datepicker2").datepicker() on page parse, but this commit removed the local jQuery/jQuery UI script tags that previously loaded before that call. Because footer.php loads JS only later (after include 'footer.php'), $/datepicker are undefined at this point, so the billing filter datepickers stop working and the inline script throws on page load.

Useful? React with 👍 / 👎.

Expand Down Expand Up @@ -363,12 +362,13 @@ class="validate"
include 'footer.php';
?>


<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.collapsible');
M.Collapsible.init(elems);
M.Collapsible.init(document.querySelectorAll('.collapsible'));
});


$(document).ready(function() {
$('.collapsible').collapsible();
$('select').formSelect();
Expand Down
46 changes: 11 additions & 35 deletions public/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,15 @@
mysqli_close($conn);
}
?>
<!--JavaScript at end of body for optimized loading-->
<!-- Scripts-->
<!-- JavaScript at end of body for optimized loading -->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="js/materialize.js"></script>
<script>document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('select');
var instances = M.FormSelect.init(elems, options);
});

// Or with jQuery

$(document).ready(function(){
$('select').formSelect();
});

</script>

<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, options);
});

// Or with jQuery

$(document).ready(function(){
$('.sidenav').sidenav();
});

</script>

<script>
$(".dropdown-trigger").dropdown();
</script>

<script type="text/javascript" src="js/materialize.min.js"></script>
<script src="js/materialize.min.js"></script>

<script>
document.addEventListener('DOMContentLoaded', function() {
M.FormSelect.init(document.querySelectorAll('select'));
M.Sidenav.init(document.querySelectorAll('.sidenav'));
M.Dropdown.init(document.querySelectorAll('.dropdown-trigger'));
M.Collapsible.init(document.querySelectorAll('.collapsible'));
});
</script>
12 changes: 0 additions & 12 deletions public/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,5 @@
<li><a href="#"><i class="material-icons left">account_circle</i><?php echo isset($_SESSION['user_id']) ? htmlspecialchars($_SESSION['user_id']) : 'Guest'; ?></a></li>
<li><a href="kill_session.php"><i class="material-icons left">lock_open</i>Logout</a></li>
</ul>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, options);
});

// Or with jQuery

$(document).ready(function(){
$('.sidenav').sidenav();
});

</script>
</div>
Loading