mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-09 15:27:32 +00:00
Wait until jQuery is loaded before making clicky table
This commit is contained in:
parent
ec15770339
commit
4c2844e17e
@ -28,6 +28,14 @@ function navbar($links) {
|
||||
<!-- CSS -->
|
||||
<link href="includes/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="includes/css/custom.css" rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
function withjQuery(f) {
|
||||
if (window.jQuery) f();
|
||||
else window.setTimeout(function () {
|
||||
withjQuery(f);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<header class="navbar navbar-default navbar-static-top" role="banner">
|
||||
|
@ -361,7 +361,7 @@ class Page {
|
||||
public function table_end($clicky = true) {
|
||||
echo '</table>';
|
||||
if ($clicky) {
|
||||
echo "<script type=\"text/javascript\">$('tr').click(function(){window.location=$(this).find('a').attr('href');}).hover(function(){\$(this).toggleClass('hover');});</script>";
|
||||
echo "<script type=\"text/javascript\">withjQuery(function(){ $('tr').click(function(){window.location=$(this).find('a').attr('href');}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -376,6 +376,6 @@ class Page {
|
||||
|
||||
public function active($row, $column = "active") {
|
||||
$active = $row[$column];
|
||||
return $active === "1" || $active === 1 || $active === true;
|
||||
return $active === "1" || $active === 1 || $active === true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user