Skip to content

Commit

Permalink
Replace unicode with font awesome icons in Tabulator pagination (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjaros committed Jun 15, 2023
1 parent 49c826f commit 4b94930
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ open class Tabulator<T : Any>(
error = "!!!"
}
pagination = obj {
page_size = ""
page_size = "<i class=\"fas fa-up-down\"></i>"
page_title = "#"
first = "⯇⯇"
first = "<i class=\"fas fa-angles-left\"></i>"
first_title = "<<"
last = "⯈⯈"
last = "<i class=\"fas fa-angles-right\"></i>"
last_title = ">>"
prev = ""
prev = "<i class=\"fas fa-angle-left\"></i>"
prev_title = "<"
next = ""
next = "<i class=\"fas fa-angle-right\"></i>"
next_title = ">"
all = "*"
counter = obj {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import io.kvision.core.Container
import io.kvision.core.onClick
import io.kvision.html.TAG
import io.kvision.html.div
import io.kvision.html.icon
import io.kvision.html.tag
import io.kvision.panel.SimplePanel
import io.kvision.state.ObservableValue
Expand Down Expand Up @@ -61,7 +62,8 @@ open class TabulatorPagination<T : Any>(
div(className = "tabulator-footer") {
borderTop = Border(style = BorderStyle.NONE)
bind(paginationState) { state ->
tag(TAG.BUTTON, "⯇⯇", className = "tabulator-page") {
tag(TAG.BUTTON, className = "tabulator-page") {
icon("fas fa-angles-left")
role = "button"
setAttribute("type", "button")
setAttribute("aria-label", "<<")
Expand All @@ -73,7 +75,8 @@ open class TabulatorPagination<T : Any>(
tabulator?.setPage(1)
}
}
tag(TAG.BUTTON, "", className = "tabulator-page") {
tag(TAG.BUTTON, className = "tabulator-page") {
icon("fas fa-angle-left")
role = "button"
setAttribute("type", "button")
setAttribute("aria-label", "<")
Expand Down Expand Up @@ -106,7 +109,8 @@ open class TabulatorPagination<T : Any>(
}
}
}
tag(TAG.BUTTON, "", className = "tabulator-page") {
tag(TAG.BUTTON, className = "tabulator-page") {
icon("fas fa-angle-right")
role = "button"
setAttribute("type", "button")
setAttribute("aria-label", ">")
Expand All @@ -118,7 +122,8 @@ open class TabulatorPagination<T : Any>(
tabulator?.nextPage()
}
}
tag(TAG.BUTTON, "⯈⯈", className = "tabulator-page") {
tag(TAG.BUTTON, className = "tabulator-page") {
icon("fas fa-angles-right")
role = "button"
setAttribute("type", "button")
setAttribute("aria-label", ">>")
Expand Down

0 comments on commit 4b94930

Please sign in to comment.