Commit 73a2fe60 authored by Mathieu's avatar Mathieu
Browse files

Fix file filters

parent 24ef78c9
Pipeline #1247 failed with stage
in 11 minutes and 36 seconds
......@@ -178,16 +178,15 @@ class FileToolBar(treeNodePanel: TreeNodePanel) {
val thresholdChanged = Var(false)
val thresholdInput = inputTag(fileNumberThreshold.toString).amend(
idAttr := thresholdTag,
width := "60px",
onMountFocus,
cls := "form-control",
cls := "form-control", marginTop := "11px",
cls.toggle("colorTransition") <-- thresholdChanged.signal
)
val nameInput = inputTag("").amend(
idAttr := nameTag,
width := "70px",
marginTop := "11px",
onMountFocus
)
......@@ -213,18 +212,19 @@ class FileToolBar(treeNodePanel: TreeNodePanel) {
}
def filterSubmit: () Boolean = () {
def filterSubmit {
resetFilterTools
treeNodePanel.invalidCacheAndDraw
false
}
val filterToolOpen = Var(false)
val filterTool = div(
centerElement,
span(tdStyle, label("# of entries ", labelStyle)),
span(tdStyle, form(thresholdInput, onSubmit --> { _ filterSubmit })),
span(tdStyle, label("name ", forId := nameTag, labelStyle)),
span(tdStyle, form(nameInput, onSubmit --> { _ filterSubmit }))
cls := "file-filter",
label("# of entries ", width := "30px", margin := "0 15 0 10"),
form(thresholdInput, onSubmit.preventDefault --> { _ filterSubmit }),
label("name ", width := "30px", margin := "0 15 0 10"),
form(nameInput, onSubmit.preventDefault --> { _ filterSubmit })
)
def createNewNode = {
......@@ -238,7 +238,7 @@ class FileToolBar(treeNodePanel: TreeNodePanel) {
val createFileTool = div(
addRootDirButton.element,
form(newNodeInput, onSubmit --> { _
form(newNodeInput, onSubmit.preventDefault --> { _
createNewNode
})
)
......@@ -364,9 +364,16 @@ class FileToolBar(treeNodePanel: TreeNodePanel) {
}
div(
cls := "sorting-files",
centerInDiv, backgroundColor := "#3f3d56", paddingBottom := "10px",
div(OMTags.glyph_filter, cls := "sorting-files-item", paddingLeft := "10px", onClick --> { _ filterToolOpen.update(!_) }),
div(
child <-- filterToolOpen.signal.map { fto
if (fto) filterTool
else div(minWidth := "300px")
}
),
div(
cls := "flex-row",
cls := "sorting-files",
children <-- sortingState.signal.map { ss
Seq(
item(Name, ss),
......@@ -387,8 +394,9 @@ class FileToolBar(treeNodePanel: TreeNodePanel) {
}
def getIfSelected(butt: HtmlElement) = manager.selected.now.map { m
if (m.isEmpty) div() else butt
def getIfSelected(butt: HtmlElement) = manager.selected.now.map {
m
if (m.isEmpty) div() else butt
}
lazy val element = {
......
......@@ -53,6 +53,7 @@ object OMTags {
val glyph_house = cls("bi-house-fill")
val glyph_arrow_left_right = cls("bi-arrow-left-right")
val glyph_extract = cls("bi-file-earmark-zip-fill")
lazy val glyph_filter = cls("bi-funnel-fill")
case class AlertAction(action: () Unit)
......
......@@ -723,13 +723,6 @@ package object client {
top := "-130"
)
lazy val labelStyle = Seq(
marginTop := "4",
color := WHITE,
width := "auto",
fontSize := "14"
)
lazy val tdStyle = Seq(
colBS(2),
marginBottom := "8",
......
......@@ -796,7 +796,7 @@ package object data {
case class ListFilesData(list: Seq[TreeNodeData], nbFilesOnServer: Int)
object FileFilter {
def defaultFilter = FileFilter.this (First(), Some(100), "", AlphaSorting())
def defaultFilter = FileFilter(First(), Some(100), "", AlphaSorting())
}
case class OMSettings(workspace: SafePath, version: String, versionName: String, buildTime: String, isDevelopment: Boolean)
......
......@@ -679,9 +679,10 @@ padding-bottom: 90px;
.flex-row,
.sorting-files,
.sorting-files-item,
sorting-files-group {
.sorting-files-group,
.file-filter {
display: flex;
direction: row;
flex-direction: row;
}
.center-in-div,
......@@ -769,4 +770,13 @@ padding-bottom: 90px;
color: white;
width: 10px;
padding-left: 10px;
}
.file-filter {
width: 300px;
align-items: center;
color: white;
font-size: 14px;
padding: 10px;
max-height: 60px;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment