Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
fix: simplify breadcrumb and change text
Browse files Browse the repository at this point in the history
  • Loading branch information
severo committed Apr 14, 2019
1 parent a0c89cd commit aa89980
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 34 deletions.
5 changes: 4 additions & 1 deletion docs/css/main.css

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<title>Quem bebe agrotóxicos?</title>
<!-- TODO: bundle at build -->
<script defer src="https://bundle.run/fuzzball@1.2.0"></script>
<script defer src="lib/main.pt.js?v=1555255170"></script>
<link rel="stylesheet" href="css/main.css?v=1555255170" />
<script defer src="lib/main.pt.js?v=1555256418"></script>
<link rel="stylesheet" href="css/main.css?v=1555256418" />
</head>
<body>
<section id="page-title" class="hero is-small is-primary cocktail">
Expand Down Expand Up @@ -87,11 +87,7 @@ <h2 class="subtitle is-4">
></button>
</div>
</section>
<nav
id="breadcrumb"
class="breadcrumb"
aria-label="breadcrumbs"
></nav>
<nav id="breadcrumb"></nav>
<section class="is-loading" id="details">
<section class="content" id="details-main"></section>
<footer id="details-footer">
Expand Down
2 changes: 1 addition & 1 deletion docs/lib/main.pt.js

Large diffs are not rendered by default.

21 changes: 2 additions & 19 deletions src/_javascript/breadcrumb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,17 @@ export function makeBreadcrumb(parent, dispatcher, state) {

function makeBrazil(parent) {
parent.html(null);
parent
.append('ul')
.append('li')
.classed('is-active', true)
.classed('is-hidden', true)
.append('a')
.attr('href', '#')
.attr('aria-current', 'page')
.text('{{breadcrumb.brazil}}');
}

function makeMun(parent, dispatcher, data, mun) {
parent.html(null);
const ul = parent.append('ul');
ul.append('li')
parent
.append('a')
.attr('href', '#')
.text('{{breadcrumb.brazil}}')
.text('{{breadcrumb.goto-brazil}}')
.on('click', (ft, element) => {
// invoke callbacks
dispatcher.call('breadcrumb-click-brazil', null, data);
});
ul.append('li')
.classed('is-active', true)
.append('a')
.attr('href', '#')
.attr('aria-current', 'page')
.text(mun.properties.name);
}

function startLoading(element) {
Expand Down
4 changes: 4 additions & 0 deletions src/_sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ html {
}
}

#breadcrumb {
margin-bottom: 1rem;
}

#details {
#details-main {
min-height: 150px;
Expand Down
6 changes: 1 addition & 5 deletions src/index.mustache.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ <h2 class="subtitle is-4">
></button>
</div>
</section>
<nav
id="breadcrumb"
class="breadcrumb"
aria-label="breadcrumbs"
></nav>
<nav id="breadcrumb"></nav>
<section class="is-loading" id="details">
<section class="content" id="details-main"></section>
<footer id="details-footer">
Expand Down
2 changes: 1 addition & 1 deletion src/lang/pt.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"breadcrumb": {
"brazil": "Brasil"
"goto-brazil": "Voltar para o mapa do Brasil"
},
"details": {
"cocktail": {
Expand Down

0 comments on commit aa89980

Please sign in to comment.