Assume fomantic-ui in stead of semantic-ui and add some custom styling for search and action tables

This commit is contained in:
2020-01-22 08:55:03 -05:00
parent a74878411b
commit f1b572752b
3 changed files with 39 additions and 14 deletions
@@ -1,15 +1,17 @@
Dunlop.register_setup 'ui-dropdown', (target) ->
target.find('.ui.dropdown').each ->
el = $(@)
settings = el.data() || {}
can_clear = not el.find('option:first').val()
settings.fireOnInit = true
settings.onChange = (value, text, item) ->
return unless can_clear
dropdown = $(@)
if value
clear_icon = $('<i class="delete icon"></i>').click ->
dropdown.dropdown('clear')
$(@).remove()
el.after clear_icon
el.dropdown settings
target.find('.ui.dropdown').dropdown() # assume fomantic that has the clearable class option, a lot better than the below custom code
#Dunlop.register_setup 'ui-dropdown', (target) ->
# target.find('.ui.dropdown').each ->
# el = $(@)
# settings = el.data() || {}
# can_clear = not el.find('option:first').val()
# settings.fireOnInit = true
# settings.onChange = (value, text, item) ->
# return unless can_clear
# dropdown = $(@)
# if value
# clear_icon = $('<i class="delete icon"></i>').click ->
# dropdown.dropdown('clear')
# $(@).remove()
# el.after clear_icon
# el.dropdown settings
@@ -5,6 +5,7 @@
@import ./dunlop-semantic/convenience-helpers
@import ./dunlop/components/environment-ribbon
//@import ./dunlop/components/user_management
@import ./dunlop-semantic/tables
.ui.selection.dropdown > .delete.icon
margin-right: 6px
@@ -0,0 +1,22 @@
table.ui.table
.actions
text-align: right
thead
tr.search
th, td
padding-top: 2px
padding-bottom: 2px
.clear-filters-button
display: none
&.conditions-present
th, td
background-color: #d2e1ec
.clear-filters-button
display: inline-block
.column-filter.actions
min-width: 85px
padding-right: 3px
tbody
td.actions
min-width: 112px
padding-right: 3px