Skip to content

Commit

Permalink
Place news last on frontpage, hide while loading, fix #348
Browse files Browse the repository at this point in the history
  • Loading branch information
arildm committed May 8, 2024
1 parent a806d98 commit 4586226
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/scripts/components/frontpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export default angular.module("korpApp").component("frontpage", {
<search-examples ng-if="$root._settings['frontpage']['examples']" class="w-80 grow"></search-examples>
</div>
<newsdesk ng-if="newsdeskIsEnabled" class="w-80 grow"></newsdesk>
<corpus-updates class="w-80 grow"></corpus-updates>
<newsdesk ng-if="newsdeskIsEnabled" class="w-80 grow"></newsdesk>
</div>
`,
bindings: {},
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/components/newsdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { type NewsItem, fetchNews, isEnabled } from "@/news-service"

angular.module("korpApp").component("newsdesk", {
template: html`
<div ng-if="isEnabled">
<div ng-if="isEnabled && itemsFiltered && itemsFiltered.length">
<h2 class="text-xl font-bold">{{ 'newsdesk-header' | loc:$root.lang }}</h2>
<div class="my-2 flex flex-col gap-2">
<article ng-repeat="item in itemsFiltered">
Expand Down Expand Up @@ -36,6 +36,7 @@ angular.module("korpApp").component("newsdesk", {

$scope.isEnabled = isEnabled()
$scope.items = null
$scope.itemsFiltered = null
$scope.expanded = false
$scope.NEWS_LIMIT = 3

Expand Down

0 comments on commit 4586226

Please sign in to comment.