Skip to content

Commit eba9709

Browse files
committed
feat(monument): change wikipedia articles switcher and load more
1 parent 0e21d00 commit eba9709

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

src/components/main/monument/monument.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,21 @@ <h4 class="monument__subtitle md-headline">Wikipedia</h4>
7575
<md-button class="md-primary md-icon-button"
7676
ng-repeat="wiki in $ctrl.shownInterwiki"
7777
ng-disabled="!$ctrl.monument.interwiki[wiki + 'wiki']"
78-
ng-href="{{$ctrl.monument.interwiki[wiki + 'wiki'].link}}">
78+
ng-click="$ctrl.getWikipedia(wiki, $ctrl.monument.interwiki[wiki + 'wiki'].title)">
7979
{{wiki}}
8080
</md-button>
8181
</div>
8282
<div class="article__text"
8383
ng-class="{'article__text--long' : $ctrl.showArticleLong}"
8484
ng-bind-html="$ctrl.article"></div>
85-
<md-button class="md-primary"
86-
ng-if="$ctrl.isArticleLong && !$ctrl.showArticleLong"
87-
ng-click="$ctrl.showArticleLong = true">
88-
Show more
89-
</md-button>
85+
<div class="article__more"
86+
layout="column" layout-align="center stretch"
87+
ng-if="$ctrl.isArticleLong && !$ctrl.showArticleLong">
88+
<md-button class="md-primary"
89+
ng-click="$ctrl.showArticleLong = true">
90+
Show more
91+
</md-button>
92+
</div>
9093
</div>
9194

9295
<div class="monument monument__panel">
@@ -133,7 +136,7 @@ <h4 class="monument__subtitle md-headline">Map</h4>
133136
-->
134137
<md-button class="md-primary" flex
135138
ng-href="#/map?c={{$ctrl.map.markers.marker.lat}}:{{$ctrl.map.markers.marker.lng}}:16">
136-
<md-icon>map</md-icon> Show monuments nearby
139+
<md-icon>map</md-icon> Show all monuments nearby
137140
</md-button>
138141
</div>
139142
</div>

src/components/main/monument/monument.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
1212
const langs = langService.getUserLanguages();
1313

1414
vm.getCommonsLink = getCommonsLink;
15+
vm.getWikipedia = getWikipedia;
1516
vm.image = [];
1617
vm.lang = langs[0];
1718
vm.map = {};
@@ -35,7 +36,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
3536
});
3637
}
3738

38-
function getArticleHeader(lang, name) {
39+
function getWikipedia(lang, name) {
3940
const language = lang.replace('wiki', '');
4041
WikiService.getArticleHeader(language, name).then((data) => {
4142
vm.article = $sce.trustAsHtml(data);
@@ -91,7 +92,7 @@ function controller($http, $q, $sce, $stateParams, $timeout, $window, localStora
9192
vm.monument.interwikis = Object.keys(vm.monument.interwiki).length;
9293
const articleInterwiki = vm.monument.interwiki[`${langs[0]}wiki`] || vm.monument.interwiki[`${langs[1]}wiki`] || vm.monument.interwiki[`${langs[2]}wiki`];
9394
if (articleInterwiki) {
94-
getArticleHeader(articleInterwiki.site, articleInterwiki.title);
95+
getWikipedia(articleInterwiki.site, articleInterwiki.title);
9596
}
9697
if (vm.monument.claims.P625) {
9798
const value = vm.monument.claims.P625.values[0].value;

src/components/main/monument/monument.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ mo-monument {
114114
&.article__text--long {
115115
max-height: none;
116116
}
117+
}
117118

118-
&:after {
119-
// content: "";
120-
// position: absolute; top: 0; bottom: 0; left: -15px; right: -15px;
121-
// box-shadow: inset rgb(255,255,255) 0 -20px 10px;
122-
}
119+
.article__more {
120+
margin-top: -14px;
121+
z-index: 5;
122+
box-shadow: inset rgb(255,255,255) 0 -45px 15px;
123123
}
124124

125-
.md-button {
125+
.md-icon-button {
126126
margin-top: -18px;
127127
}
128128
}

0 commit comments

Comments
 (0)