aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar maTh <1645099+math-GH@users.noreply.github.com> 2024-12-18 11:02:29 +0100
committerGravatar GitHub <noreply@github.com> 2024-12-18 11:02:29 +0100
commit3b87372061b16d172899b29fe9b5414b9194abd4 (patch)
tree9c743380eedf09cfcb6c1c74d73d5252a562eba2
parentff47cab30bd0310b3e5daa1554f6e9231b1d8cb2 (diff)
fix: sharing menu entry id (#7113)
* fix sharing menu entry id * Update main.js
-rw-r--r--app/views/helpers/index/normal/entry_share_menu.phtml2
-rw-r--r--app/views/index/normal.phtml1
-rw-r--r--p/scripts/main.js2
3 files changed, 4 insertions, 1 deletions
diff --git a/app/views/helpers/index/normal/entry_share_menu.phtml b/app/views/helpers/index/normal/entry_share_menu.phtml
index af699210a..ca41b23a5 100644
--- a/app/views/helpers/index/normal/entry_share_menu.phtml
+++ b/app/views/helpers/index/normal/entry_share_menu.phtml
@@ -4,6 +4,7 @@
?>
<ul class="dropdown-menu">
<li class="dropdown-header"><?= _t('index.share') ?> <a href="<?= _url('configure', 'integration') ?>"><?= _i('configure') ?></a></li><?php
+ $id = '--entryId--';
$link = '--link--';
$title = '--titleText----websiteName----articleAuthors--';
foreach (FreshRSS_Context::userConf()->sharing as $share_options) {
@@ -12,6 +13,7 @@
continue;
}
$cssClass = $share->isDeprecated() ? ' error' : '';
+ $share_options['id'] = $id;
$share_options['link'] = $link;
$share_options['title'] = $title;
$share->update($share_options);
diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml
index 4ebcb28a6..fc242ae0f 100644
--- a/app/views/index/normal.phtml
+++ b/app/views/index/normal.phtml
@@ -87,6 +87,7 @@ $today = @strtotime('today');
?><?= $this->entry->isFavorite() ? ' favorite' : ''
?><?= $useKeepUnreadImportant && ($this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT) ? ' keep_unread ' : ''
?>" id="flux_<?= $this->entry->id()
+ ?>" data-entry="<?= $this->entry->id()
?>" data-feed="<?= $this->feed->id()
?>" data-priority="<?= $this->feed->priority()
?>"><?php
diff --git a/p/scripts/main.js b/p/scripts/main.js
index baedda55c..a1cf5d8ae 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -721,7 +721,7 @@ function show_share_menu(el) {
const dropdownMenu = div.querySelector('.dropdown-menu');
if (!dropdownMenu) {
- const itemId = el.closest('.flux').id;
+ const itemId = el.closest('.flux').dataset.entry;
const templateId = 'share_article_template';
const id = itemId;
const flux_header_el = el.closest('.flux');