Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miniflux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
miniflux
Commits
cc888e2a
Commit
cc888e2a
authored
3 years ago
by
pennae
Committed by
fguillot
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
set items to read on click/middle-click of external link
parent
d9f91fd9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ui/static/js/app.js
+17
-2
17 additions, 2 deletions
ui/static/js/app.js
ui/static/js/bootstrap.js
+9
-0
9 additions, 0 deletions
ui/static/js/bootstrap.js
with
26 additions
and
2 deletions
ui/static/js/app.js
+
17
−
2
View file @
cc888e2a
...
...
@@ -12,6 +12,19 @@ function onClick(selector, callback, noPreventDefault) {
});
}
function
onAuxClick
(
selector
,
callback
,
noPreventDefault
)
{
let
elements
=
document
.
querySelectorAll
(
selector
);
elements
.
forEach
((
element
)
=>
{
element
.
onauxclick
=
(
event
)
=>
{
if
(
!
noPreventDefault
)
{
event
.
preventDefault
();
}
callback
(
event
);
};
});
}
// Show and hide the main menu on mobile devices.
function
toggleMainMenu
()
{
let
menu
=
document
.
querySelector
(
"
.header nav ul
"
);
...
...
@@ -115,11 +128,13 @@ function markPageAsRead() {
}
// Handle entry status changes from the list view and entry view.
function
handleEntryStatus
(
element
)
{
function
handleEntryStatus
(
element
,
setToRead
)
{
let
toasting
=
!
element
;
let
currentEntry
=
findEntry
(
element
);
if
(
currentEntry
)
{
toggleEntryStatus
(
currentEntry
,
toasting
);
if
(
!
setToRead
||
currentEntry
.
querySelector
(
"
a[data-toggle-status]
"
).
dataset
.
value
==
"
unread
"
)
{
toggleEntryStatus
(
currentEntry
,
toasting
);
}
if
(
isListView
()
&&
currentEntry
.
classList
.
contains
(
'
current-item
'
))
{
goToNextListItem
();
}
...
...
This diff is collapsed.
Click to expand it.
ui/static/js/bootstrap.js
+
9
−
0
View file @
cc888e2a
...
...
@@ -61,6 +61,15 @@ document.addEventListener("DOMContentLoaded", function () {
request
.
execute
();
}));
onClick
(
"
a[data-original-link]
"
,
(
event
)
=>
{
handleEntryStatus
(
event
.
target
,
true
);
},
true
);
onAuxClick
(
"
a[data-original-link]
"
,
(
event
)
=>
{
if
(
event
.
button
==
1
)
{
handleEntryStatus
(
event
.
target
,
true
);
}
},
true
);
if
(
document
.
documentElement
.
clientWidth
<
600
)
{
onClick
(
"
.logo
"
,
()
=>
toggleMainMenu
());
onClick
(
"
.header nav li
"
,
(
event
)
=>
onClickMainMenuListItem
(
event
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment