Browse Source

細部の修正

bc-detail
miteruzo 9 months ago
parent
commit
1cc8ffe594
3 changed files with 9 additions and 7 deletions
  1. +1
    -0
      broadcast/.gitignore
  2. +5
    -5
      broadcast/pagination.cmp.php
  3. +3
    -2
      broadcast/script.js

+ 1
- 0
broadcast/.gitignore View File

@@ -1,2 +1,3 @@
/log.txt /log.txt
/log2.txt



+ 5
- 5
broadcast/pagination.cmp.php View File

@@ -1,5 +1,5 @@
<nav class="d-flex justify-content-center" aria-label="..."> <nav class="d-flex justify-content-center" aria-label="...">
<ul class="pagination">
<ul class="pagination opacity-0">
<?php if ($page > 1): ?> <?php if ($page > 1): ?>
<li class="page-item"> <li class="page-item">
<a class="page-link no-wrap" href="javascript: void (0)" onclick="Script.jumpTo (1)">|&lt;</a> <a class="page-link no-wrap" href="javascript: void (0)" onclick="Script.jumpTo (1)">|&lt;</a>
@@ -10,8 +10,8 @@
</li> </li>
<?php endif ?> <?php endif ?>


<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1), $j = 9; $i < $page; ++$i, --$j): ?>
<li class="page-item page-<?= $j ?>">
<?php for ($i = max (min ($page + 10, $pages_max) - 20, 1); $i < $page; ++$i): ?>
<li class="page-item page-<?= $page - $i ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a> <a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
</li> </li>
<?php endfor ?> <?php endfor ?>
@@ -20,8 +20,8 @@
<span class="page-link"><?= $page ?></span> <span class="page-link"><?= $page ?></span>
</li> </li>


<?php for ($i = $page + 1, $j = 0; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i, ++$j): ?>
<li class="page-item page-<?= $j ?>">
<?php for ($i = $page + 1; $i <= min (max ($page - 10, 1) + 20, $pages_max); ++$i): ?>
<li class="page-item page-<?= $i - $page ?>">
<a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a> <a class="page-link" href="javascript: void (0)" onclick="Script.jumpTo (<?= $i ?>)"><?= $i ?></a>
</li> </li>
<?php endfor ?> <?php endfor ?>


+ 3
- 2
broadcast/script.js View File

@@ -66,6 +66,7 @@ Script


$ (window).resize (this.setPagination); $ (window).resize (this.setPagination);
this.setPagination (); this.setPagination ();
$ ('.pagination').removeClass ('opacity-0');
} }


static static
@@ -82,10 +83,10 @@ Script
static static
setPagination () setPagination ()
{ {
for (let i = 0; i < 10; ++i)
for (let i = 1; i <= 20; ++i)
$ (`.page-${i}`).removeClass ('d-none'); $ (`.page-${i}`).removeClass ('d-none');


for (let i = 9; i > 0; --i)
for (let i = 20; i > 1; --i)
{ {
if ($ ('.pagination').width () >= $ ('body').width () * .8) if ($ ('.pagination').width () >= $ ('body').width () * .8)
$ (`.page-${i}`).addClass ('d-none'); $ (`.page-${i}`).addClass ('d-none');


Loading…
Cancel
Save