mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Limit jQuery attempts to 30 (3 seconds)
This commit is contained in:
parent
6031097f30
commit
d6c1d89bd4
@ -68,10 +68,10 @@ $settings = $this->page->settings;
|
||||
<link href="<?php echo $this->page->autoversion('inc/css/glyphicons.min.css'); ?>" rel="stylesheet">
|
||||
<link href="<?php echo $this->page->autoversion('inc/css/custom.css'); ?>" rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
function withjQuery(f) {
|
||||
function withjQuery(tries, f) {
|
||||
if (window.jQuery) f();
|
||||
else window.setTimeout(function () {
|
||||
withjQuery(f);
|
||||
else if (tries > 0) window.setTimeout(function () {
|
||||
withjQuery(tries - 1, f);
|
||||
}, 100);
|
||||
}
|
||||
</script>
|
||||
@ -100,8 +100,8 @@ $settings = $this->page->settings;
|
||||
));
|
||||
?>
|
||||
<ul class="nav navbar-nav my-2 my-lg-0">
|
||||
<a href="https://www.spigotmc.org/resources/litebans.3715/"
|
||||
target="_blank">© LiteBans</a>
|
||||
<a href="https://www.spigotmc.org/resources/litebans.3715/"
|
||||
target="_blank">© LiteBans</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -574,7 +574,7 @@ class Page {
|
||||
function table_end($clicky = true) {
|
||||
echo '</table>';
|
||||
if ($clicky) {
|
||||
echo "<script type=\"text/javascript\">withjQuery(function(){ $('tr').click(function(){var href=$(this).find('a').attr('href');if(href!==undefined)window.location=href;}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
||||
echo "<script type=\"text/javascript\">withjQuery(30,function(){ $('tr').click(function(){var href=$(this).find('a').attr('href');if(href!==undefined)window.location=href;}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user