Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
28e637da
Commit
28e637da
authored
3 years ago
by
xaralis
Browse files
Options
Downloads
Patches
Plain Diff
fix(district): geo feature collection navigation from category listing
parent
6d5e928a
No related branches found
No related tags found
2 merge requests
!512
fix(district): geo feature collection navigation from category listing
,
!511
fix(district): geo feature collection navigation from category listing
Pipeline
#8212
passed
3 years ago
Stage: build
Changes
1
Pipelines
4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
district/templates/district/district_geo_feature_collection_page.html
+23
-2
23 additions, 2 deletions
...plates/district/district_geo_feature_collection_page.html
with
23 additions
and
2 deletions
district/templates/district/district_geo_feature_collection_page.html
+
23
−
2
View file @
28e637da
...
...
@@ -79,9 +79,9 @@
{% for feature in features %}
<li>
<span
class=
"rounded-full inline-flex items-center justify-center bg-grey-125 font-bold text-center text-xs w-5 h-5 mr-2 no-underline"
>
<a
href=
"
#
{{feature.pk}}-{{feature.slug}}"
class=
"no-underline"
>
{{ feature.index }}
</a>
<a
href=
"
?item=
{{feature.pk}}-{{feature.slug}}"
class=
"no-underline
js-feature-item-anchor
"
>
{{ feature.index }}
</a>
</span>
<a
href=
"
#
{{feature.pk}}-{{feature.slug}}"
><span
class=
"text-sm underline"
>
{{ feature.title }}
</span></a>
<a
href=
"
?item=
{{feature.pk}}-{{feature.slug}}"
class=
"js-feature-item-anchor"
><span
class=
"text-sm underline"
>
{{ feature.title }}
</span></a>
</a>
</li>
{% endfor %}
...
...
@@ -109,3 +109,24 @@
</div>
</article>
{% endblock %}
{% block scripts %}
<script>
/* Handle .js-feature-item-anchor clicks without page reloads. */
Array
.
from
(
document
.
getElementsByClassName
(
"
js-feature-item-anchor
"
)).
forEach
((
el
)
=>
{
el
.
addEventListener
(
"
click
"
,
(
evt
)
=>
{
evt
.
preventDefault
();
const
url
=
new
URL
(
window
.
location
);
// Set slug from URL.
url
.
searchParams
.
set
(
"
item
"
,
el
.
getAttribute
(
"
href
"
).
substring
(
6
));
// Emulate user browser navigation event.
history
.
pushState
({},
""
,
url
);
window
.
dispatchEvent
(
new
Event
(
"
popstate
"
));
return
false
;
})
})
</script>
{% endblock %}
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