3dae99ac27
The item id exists as data attribute or as element.id postfix on multiple elements in an article. The basic idea is to traverse the DOM tree - starting from the event firing element - in reverse order till an article element is found. This article element is passed to the JavaScript functions. These JavaScript functions are getting the elements which they want to manipulate starting from the article utilizing the JavaScript querySelector function. The bootstrap themes had a conflicting and unused class style definied, which is removed by now.
17 lines
681 B
PHP
17 lines
681 B
PHP
<li class="hide-mobile">
|
|
<?php if ($item['bookmark']): ?>
|
|
<a
|
|
class="bookmark"
|
|
href="?action=bookmark&value=0&id=<?= $item['id'] ?>&menu=<?= $menu ?>&offset=<?= $offset ?>&source=<?= $source ?>"
|
|
data-action="bookmark"
|
|
data-reverse-label="<?= t('bookmark') ?>"
|
|
><?= t('remove bookmark') ?></a>
|
|
<?php else: ?>
|
|
<a
|
|
class="bookmark"
|
|
href="?action=bookmark&value=1&id=<?= $item['id'] ?>&menu=<?= $menu ?>&offset=<?= $offset ?>&source=<?= $source ?>"
|
|
data-action="bookmark"
|
|
data-reverse-label="<?= t('remove bookmark') ?>"
|
|
><?= t('bookmark') ?></a>
|
|
<?php endif ?>
|
|
</li>
|