Skip to content

Commit 014ef3c

Browse files
committed
Minor fix based on feedback
1 parent 0bfc7ba commit 014ef3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/scrivener/html.ex

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
defmodule Scrivener.HTML do
22
use Phoenix.HTML
3-
@defaults [view_style: :bootstrap, action: :index, page_param: :page]
3+
@defaults [view_style: :bootstrap, action: :index, page_param: :page, hide_single: false]
44
@view_styles [:bootstrap, :semantic, :foundation, :bootstrap_v4, :materialize, :bulma]
55
@raw_defaults [
66
distance: 5,
@@ -119,7 +119,9 @@ defmodule Scrivener.HTML do
119119

120120
hide_single_result = opts[:hide_single] && paginator.total_pages < 2
121121

122-
unless hide_single_result do
122+
if hide_single_result do
123+
Phoenix.HTML.raw(nil)
124+
else
123125
# Ensure ordering so pattern matching is reliable
124126
_pagination_links(paginator,
125127
view_style: merged_opts[:view_style],
@@ -128,8 +130,6 @@ defmodule Scrivener.HTML do
128130
page_param: merged_opts[:page_param],
129131
params: params
130132
)
131-
else
132-
Phoenix.HTML.raw(nil)
133133
end
134134
end
135135

0 commit comments

Comments
 (0)