From 77435f6d5939df93326b81b0a696c51f163a1f14 Mon Sep 17 00:00:00 2001 From: madalingorbanescu Date: Wed, 4 Dec 2019 15:17:30 +0200 Subject: [PATCH] Do not show delete pin on first location url see #41 --- features/metaboxes/css/style.css | 8 +++- features/metaboxes/fields/gmap_pins.php | 11 ++++- features/metaboxes/scss/style.scss | 54 +++++++++++++------------ 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/features/metaboxes/css/style.css b/features/metaboxes/css/style.css index 29754f2..2e30f25 100644 --- a/features/metaboxes/css/style.css +++ b/features/metaboxes/css/style.css @@ -2934,6 +2934,7 @@ div.time-picker li.selected { .gmap_pins_container { position: relative; } .gmap_pins_container .gmap_pin { + position: relative; display: flex; justify-content: space-between; } .gmap_pins_container .gmap_pin > * { @@ -2943,7 +2944,10 @@ div.time-picker li.selected { .gmap_pins_container .gmap_pin .pin_name { flex-basis: 29%; } .gmap_pins_container .gmap_pin .pin_delete { - flex-basis: 2%; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: -12px; opacity: 0; color: #AA0000; } .gmap_pins_container .gmap_pin:hover .pin_delete { @@ -3413,7 +3417,7 @@ body .mce-toolbar.mce-last .mce-container.mce-first .mce-menubtn.mce-first .mce- .cmb-type-colorpicker .wp-color-result:after { content: none; } .cmb-type-colorpicker .wp-color-result .wp-color-result-text { - display: none; } + display: none; } .cmb-type-colorpicker .wp-picker-container { position: absolute; right: 0; diff --git a/features/metaboxes/fields/gmap_pins.php b/features/metaboxes/fields/gmap_pins.php index 3370e13..444f71f 100644 --- a/features/metaboxes/fields/gmap_pins.php +++ b/features/metaboxes/fields/gmap_pins.php @@ -31,7 +31,10 @@ } } + $counter = 0; + foreach ( $meta as $key => $pin ) { ?> +
  • - + 0 ) { ?> + +
  • @@ -55,4 +62,4 @@ - \ No newline at end of file + diff --git a/features/metaboxes/scss/style.scss b/features/metaboxes/scss/style.scss index ed513af..24425b4 100644 --- a/features/metaboxes/scss/style.scss +++ b/features/metaboxes/scss/style.scss @@ -1743,7 +1743,7 @@ $accent: #07d3f8; .gmap_pins_container { flex-basis: 100%; } - + // Hide default field description .cmb_metabox_description { display: none; @@ -1755,6 +1755,7 @@ $accent: #07d3f8; // padding-bottom: 30px; .gmap_pin { + position: relative; display: flex; justify-content: space-between; & > * { @@ -1770,7 +1771,10 @@ $accent: #07d3f8; } .pin_delete { - flex-basis: 2%; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: -12px; opacity: 0; color: #AA0000; } @@ -1938,7 +1942,7 @@ $accent: #07d3f8; &:last-of-type { padding-bottom: 0; } - + & + .cmb-type { border-top: 1px solid #EEEEEE; } @@ -1953,7 +1957,7 @@ $accent: #07d3f8; // Sidebar #postbox-container-1 & { padding: 10px 0; - + + .cmb-type { border-top: none; } @@ -2063,11 +2067,11 @@ $accent: #07d3f8; display: none; } } - .cmb-type-wysiwyg, - // .cmb-type-textarea_small, - // .cmb-type-textarea, + .cmb-type-wysiwyg, + // .cmb-type-textarea_small, + // .cmb-type-textarea, // .cmb-type-textarea_medium, - // .cmb-type-text, + // .cmb-type-text, { .cmb_metabox_description { flex-basis: 100%; @@ -2102,25 +2106,25 @@ $accent: #07d3f8; width: 100%; } .cmb_metabox { - input[type=text], - input[type=search], - input[type=tel], - input[type=time], - input[type=url], - input[type=week], - input[type=password], - input[type=date], - input[type=datetime], - input[type=datetime-local], - input[type=email], + input[type=text], + input[type=search], + input[type=tel], + input[type=time], + input[type=url], + input[type=week], + input[type=password], + input[type=date], + input[type=datetime], + input[type=datetime-local], + input[type=email], input[type=month], - input[type=number], - select, - // textarea + input[type=number], + select, + // textarea { @extend %input-fields; } - + } .cmb_metabox select, @@ -2178,7 +2182,7 @@ $accent: #07d3f8; display: flex; flex-wrap: nowrap; align-items: flex-start; - + // Checkbox input[type=checkbox], input[type=radio] { @@ -2281,7 +2285,7 @@ $accent: #07d3f8; right: -19px; } } - + } .cmb-type-text_range output {