From c2fd00e6a0db1867ba7ecec9f9743e2957e75e42 Mon Sep 17 00:00:00 2001 From: David Molineus Date: Mon, 16 Oct 2017 16:58:17 +0200 Subject: [PATCH] Add styles for the mcw (Fix #51). --- .../contao/dca/tl_leaflet_control.php | 2 +- .../Resources/contao/dca/tl_leaflet_layer.php | 1 + .../Resources/contao/dca/tl_leaflet_map.php | 2 +- .../contao/dca/tl_leaflet_vector.php | 1 + src/Bundle/Resources/public/css/backend.css | 32 +++++++++++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/Bundle/Resources/contao/dca/tl_leaflet_control.php b/src/Bundle/Resources/contao/dca/tl_leaflet_control.php index e79ee22..b5403f1 100644 --- a/src/Bundle/Resources/contao/dca/tl_leaflet_control.php +++ b/src/Bundle/Resources/contao/dca/tl_leaflet_control.php @@ -268,7 +268,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_control'] = [ ['netzmacht.contao_leaflet.listeners.dca.control', 'saveLayerRelations'], ], 'eval' => [ - 'tl_class' => 'clr', + 'tl_class' => 'leaflet-mcw leaflet-mcw-control-layers', 'columnFields' => [ 'layer' => [ 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_control']['layer'], diff --git a/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php b/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php index 303f954..9e77edb 100644 --- a/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php +++ b/src/Bundle/Resources/contao/dca/tl_leaflet_layer.php @@ -810,6 +810,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_layer'] = [ 'inputType' => 'multiColumnWizard', 'options_callback' => ['netzmacht.contao_leaflet.listeners.dca.layer', 'getIcons'], 'eval' => [ + 'tl_class' => 'leaflet-mcw leaflet-mcw-amenity-icons', 'columnFields' => [ 'amenity' => [ 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_layer']['amenity'], diff --git a/src/Bundle/Resources/contao/dca/tl_leaflet_map.php b/src/Bundle/Resources/contao/dca/tl_leaflet_map.php index 26e5c62..6b701f2 100644 --- a/src/Bundle/Resources/contao/dca/tl_leaflet_map.php +++ b/src/Bundle/Resources/contao/dca/tl_leaflet_map.php @@ -195,6 +195,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [ 'eval' => [ 'multiple' => true, 'doNotSaveEmpty' => true, + 'tl_class' => 'leaflet-mcw leaflet-mcw-map-layers', 'columnFields' => [ 'reference' => [ 'label' => &$GLOBALS['TL_LANG']['tl_leaflet_map']['reference'], @@ -206,7 +207,6 @@ $GLOBALS['TL_DCA']['tl_leaflet_map'] = [ 'tl_class' => 'w50', 'chosen' => true, 'includeBlankOption' => true, - 'style' => 'width: 300px', ], 'sql' => "int(10) unsigned NOT NULL default '0'", ], diff --git a/src/Bundle/Resources/contao/dca/tl_leaflet_vector.php b/src/Bundle/Resources/contao/dca/tl_leaflet_vector.php index 34d4260..977b3ac 100644 --- a/src/Bundle/Resources/contao/dca/tl_leaflet_vector.php +++ b/src/Bundle/Resources/contao/dca/tl_leaflet_vector.php @@ -326,6 +326,7 @@ $GLOBALS['TL_DCA']['tl_leaflet_vector'] = [ 'inputType' => 'multiColumnWizard', 'search' => false, 'eval' => [ + 'tl_class' => 'leaflet-mcw', 'mandatory' => true, 'alwaysSave' => true, 'flatArray' => true, diff --git a/src/Bundle/Resources/public/css/backend.css b/src/Bundle/Resources/public/css/backend.css index 256a3c8..36cc7b9 100644 --- a/src/Bundle/Resources/public/css/backend.css +++ b/src/Bundle/Resources/public/css/backend.css @@ -26,3 +26,35 @@ .long .tl_text_2 { width: 325px; } + +.leaflet-mcw { + clear: both; +} + +.leaflet-mcw .tl_modulewizard { + width: 100%; +} + +.leaflet-mcw .multicolumnwizard textarea, +.leaflet-mcw .multicolumnwizard .tl_select { + width: 100% !important; +} + +.leaflet-mcw .tl_modulewizard td:first-child { + width: auto; +} + +@media screen and (min-width: 768px) { + .leaflet-mcw .tl_modulewizard { + max-width: 75%; + } + + .leaflet-mcw-map-layers .tl_modulewizard { + max-width: 45%; + } + + .leaflet-mcw-amenity-icons td:nth-child(1), + .leaflet-mcw-control-layers td:nth-child(2) { + width: 35%; + } +}