From 9fca89da4175f03b62201ea610d001506a9c1464 Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Fri, 15 Jul 2016 16:38:42 +0200 Subject: [PATCH 1/5] Adding class and CSS for cases where a label-less field is shorter than a labeled field --- class.cmb-meta-box.php | 9 ++++++++- css/dist/cmb.min.css | 6 +++--- css/src/layout.css | 26 ++++++++++++++++---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/class.cmb-meta-box.php b/class.cmb-meta-box.php index c724e8e9..842e8192 100644 --- a/class.cmb-meta-box.php +++ b/class.cmb-meta-box.php @@ -279,6 +279,13 @@ static function layout_fields( array $fields ) { ?> if ( ! empty( $field->args['sortable'] ) ) $classes[] = 'cmb-sortable'; + // Assign extra class for has label or has no label + if ( ! empty( $field->title ) ) { + $label_designation = 'cmb-has-label'; + } else { + $label_designation = 'cmb-no-label'; + } + $attrs = array( sprintf( 'id="%s"', sanitize_html_class( $field->id ) ), sprintf( 'class="%s"', esc_attr( implode(' ', array_map( 'sanitize_html_class', $classes ) ) ) ) @@ -290,7 +297,7 @@ static function layout_fields( array $fields ) { ?> ?> -
+
> display(); ?> diff --git a/css/dist/cmb.min.css b/css/dist/cmb.min.css index fd348697..e6f629f4 100644 --- a/css/dist/cmb.min.css +++ b/css/dist/cmb.min.css @@ -1,6 +1,6 @@ /** - * Custom-Meta-Boxes - v1.0.1 - 2014-09-07 + * Custom-Meta-Boxes - v1.0.1 - 2016-07-15 * https://github.com/humanmade/Custom-Meta-Boxes/ - * Copyright (c) 2014 Human Made Limited; License: GPL-2.0+ + * Copyright (c) 2016 Human Made Limited; License: GPL-2.0+ */ -.cmb_metabox .field{overflow:hidden;padding:16px 0;border-bottom:1px solid #DFDFDF}.cmb-row:last-child>[class*=cmb-cell-]>.field{border-bottom:0}.postbox>.inside>.cmb_metabox{margin:-10px 0}.cmb_metabox .cmb-row{overflow:hidden;margin:0 -5px;zoom:1}.cmb_metabox .cmb-row:after,.cmb_metabox .cmb-row:before{content:"";display:table}.cmb_metabox .cmb-row:after{clear:both}.cmb_metabox [class*=cmb-cell-]{float:left;padding:0 5px;-moz-box-sizing:border-box;box-sizing:border-box}.cmb_metabox .cmb-cell-1{width:8.333333333%}.cmb_metabox .cmb-cell-2{width:16.666666667%}.cmb_metabox .cmb-cell-3{width:25%}.cmb_metabox .cmb-cell-4{width:33.333333333%}.cmb_metabox .cmb-cell-5{width:41.666666667%}.cmb_metabox .cmb-cell-6{width:50%}.cmb_metabox .cmb-cell-7{width:58.333333333%}.cmb_metabox .cmb-cell-8{width:66.666666667%}.cmb_metabox .cmb-cell-9{width:75%}.cmb_metabox .cmb-cell-10{width:83.333333333%}.cmb_metabox .cmb-cell-11{width:91.666666667%}.cmb_metabox .cmb-cell-12{width:100%}@media all and (max-width:850px){.cmb_metabox [class*=cmb-cell-]{width:100%}}.cmb_metabox .field-item{position:relative}.cmb_metabox_description{color:#AAA;font-style:italic;margin:0 0 16px!important}.cmb_metabox input[type=text],.cmb_metabox select,.cmb_metabox textarea{width:100%;margin:0}.cmb_metabox input.cmb_text_small{width:100px}.cmb_metabox input.cmb_text_medium{width:230px;margin-right:15px}.cmb_metabox input[type=checkbox],.cmb_metabox input[type=radio]{margin:0 5px 0 0;padding:0}.cmb_metabox .field-title{margin-bottom:16px;margin-top:0;font-weight:700}.cmb_metabox .field-title label{vertical-align:baseline}.cmb_metabox .select2-search-choice-close{-webkit-transition:none;transition:none;top:3px}.cmb_metabox [disabled]{background:#F7F7F7}.cmb_metabox .field.repeatable>.field-item{padding-right:30px;margin-bottom:10px}.cmb_metabox .repeat-field{display:block!important;clear:both}.CMB_Date_Field.repeatable .field-item,.CMB_Date_Timestamp_Field.repeatable .field-item,.CMB_Datetime_Timestamp_Field.repeatable .field-item,.CMB_Text_Small_Field.repeatable .field-item,.CMB_Time_Field.repeatable .field-item{float:left;clear:both}.cmb-delete-field{display:inline-block;text-decoration:none;font-size:11px;line-height:20px;height:22px;width:22px;margin:0;padding:0;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top;position:absolute;top:3px;right:0;text-indent:100%;overflow:hidden;white-space:nowrap}.cmb-delete-field:active,.cmb-delete-field:focus,.cmb-delete-field:hover{background:#fafafa;border-color:#999;color:#222}.cmb-delete-field .cmb-delete-field-icon{content:' ';display:block;position:absolute;height:8px;width:8px;top:50%;left:50%;margin-top:-4px;margin-left:-4px;background-image:url( '../../images/cmb-icon-remove.png');background-repeat:no-repeat;text-indent:8px;overflow:hidden}@media only screen and (-webkit-min-device-pixel-ratio :1.5),only screen and (min-device-pixel-ratio :1.5){.cmb-delete-field .cmb-delete-field-icon{background-image:url( '../../images/cmb-icon-remove@2x.png');background-size:8px 8px}}.cmb-sortable>.field-item{padding-left:15px}.cmb-sortable .cmb-handle{height:100%;width:3px;position:absolute;top:0;left:0;background:0 0;cursor:move;border-left:3px solid #DFDFDF;border-right:3px solid #DFDFDF}.cmb-sortable .ui-sortable-helper{opacity:.75}.cmb-sortable .ui-sortable-helper:before{content:' ';position:absolute;width:100%;height:100%;top:-6px;left:-6px;background-color:#F8F8F8;border:1px solid #DEDEDE;padding:5px;z-index:-1}.cmb-sortable>.ui-sortable-placeholder{border:1px dashed #DDD!important;background:transparent!important;visibility:visible!important;margin-bottom:8px!important}.cmb_metabox .CMB_Group_Field>.field-title{font-size:20px;clear:left;color:#222;font-family:'Open Sans',sans-serif;font-weight:400;margin:8px 0}.cmb_metabox .CMB_Group_Field.repeatable>.field-title{margin-bottom:16px}.cmb_metabox .CMB_Group_Field.repeatable>.field-item{padding:30px 10px 0;margin-bottom:16px;border:1px solid #DDD;background:#FAFAFA;position:relative}.cmb_metabox .CMB_Group_Field.repeatable>.field-item:before{content:' ';display:block;position:absolute;top:0;left:0;right:0;height:33px;border-bottom:1px solid #DDD}.cmb_metabox .CMB_Group_Field.repeatable>.field-item>.cmb-delete-field{top:5px;right:5px;width:auto;text-indent:0;padding-left:24px;padding-right:8px;height:22px;line-height:20px;font-size:11px;z-index:1}.cmb_metabox .CMB_Group_Field.repeatable>.field-item>.cmb-delete-field .cmb-delete-field-icon{left:12px}.CMB_Group_Field.cmb-sortable>.field-item{position:relative;padding-top:30px}.CMB_Group_Field.cmb-sortable>.field-item>.cmb-handle{top:-1px;left:-1px;right:-1px;height:34px;width:auto;border:0;border-bottom:1px solid #DDD}.CMB_Group_Field.cmb-sortable>.field-item.ui-sortable-helper>.cmb-handle{padding:0 5px}.cmb_metabox .CMB_Group_Field.repeatable.cmb-sortable>.field-item:before{display:none!important}.CMB_Group_Field.cmb-sortable>.ui-sortable-placeholder{margin-bottom:16px!important}.CMB_Group_Field .cmb_metabox>.cmb-row:last-child{margin-bottom:0}.CMB_File_Field .field-item,.CMB_Image_Field .field-item{float:left;margin:0 16px 16px 0!important;text-align:center;padding:0!important;z-index:1}.cmb-file-wrap{position:relative;overflow:hidden;width:150px;height:150px;line-height:150px}.cmb-file-wrap-placeholder{content:' ';position:absolute;top:0;left:0;display:block;height:142px;width:142px;border:4px dashed #DDD;z-index:-1}.cmb-file-wrap-placeholder .dimensions{line-height:normal;position:absolute;bottom:10px;right:10px;font-size:18px;font-weight:700;opacity:.2}.cmb-file-holder{position:relative;overflow:hidden;box-shadow:inset 0 0 15px rgba(0,0,0,.1),inset 0 0 0 1px rgba(0,0,0,.05);background:#eee;width:100%;height:100%}.cmb-file-holder.type-file img{position:absolute;top:43%;margin-top:-30px;left:50%;margin-left:-23px}.cmb-file-holder.type-img img{width:100%;height:auto;margin-top:0;vertical-align:top}.cmb-file-holder.type-img::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);overflow:hidden;z-index:1}.cmb-file-name{position:absolute;left:0;right:0;bottom:0;line-height:1.4;overflow:hidden;max-height:100%;word-wrap:break-word;text-align:center;font-weight:700;background:rgba(255,255,255,.8);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.cmb-file-name strong{padding:5px 10px;display:block}.CMB_File_Field .cmb-delete-field,.CMB_Image_Field .cmb-delete-field{z-index:10;top:10px;right:10px}.CMB_File_Field .cmb-remove-file,.CMB_Image_Field .cmb-remove-file{position:absolute;z-index:1;top:5px;right:5px}.CMB_File_Field.repeatable .cmb-remove-file,.CMB_Image_Field.repeatable .cmb-remove-file{display:none!important}.cmb-file-wrap .cmb-file-upload{vertical-align:middle}.cmb-loading::before{content:' ';display:block;background:url( '../../images/wpspin.gif' ) no-repeat;width:16px;height:16px;position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}@media only screen and (-webkit-min-device-pixel-ratio :1.5),only screen and (min-device-pixel-ratio :1.5){.cmb-loading::before{background-image:url( '../../images/wpspin-2x.gif');background-size:16px 16px}}.CMB_File_Field.cmb-sortable .cmb-handle,.CMB_Image_Field.cmb-sortable .cmb-handle{border:0;background:0 0;height:100%;width:100%;z-index:1}.CMB_File_Field.cmb-sortable .cmb-file-upload,.CMB_Image_Field.cmb-sortable .cmb-file-upload{position:relative;z-index:5}.CMB_File_Field.cmb-sortable .ui-sortable-helper:before,.CMB_Image_Field.cmb-sortable .ui-sortable-helper:before{top:0;left:0;padding:0;border:0;background:#F9F9F9}.CMB_Title .field-title{margin:8px 0!important}.CMB_Title{border-bottom:0;padding-bottom:0;margin-top:16px}.CMB_Title h2{margin:0!important;padding:0!important}.CMB_Color_Picker .field-item{float:left;clear:both}.CMB_Color_Picker:after,.CMB_Color_Picker:before{content:"";display:table}.CMB_Color_Picker:after{clear:both}.CMB_Color_Picker{zoom:1}div.time-picker{position:absolute;height:191px;width:4em;overflow:auto;background:#fff;border:1px solid #aaa;z-index:99;margin:0}div.time-picker-12hours{width:6em}div.time-picker ul{list-style-type:none;margin:0;padding:0}div.time-picker li{cursor:pointer;height:10px;font:12px/1 Helvetica,Arial,sans-serif;padding:4px 3px}div.time-picker li.selected{background:#0063CE;color:#fff}.cmb_metabox input.cmb_timepicker{width:100px;margin-right:0}.CMB_Datetime_Timestamp_Field input+input{margin-left:4px}.cmb_select{width:100%}.select2-offscreen{display:none} \ No newline at end of file +.cmb_metabox .field{overflow:hidden;padding:16px 0;border-bottom:1px solid #DFDFDF}.cmb-row:last-child>[class*=cmb-cell-]>.field{border-bottom:0}.postbox>.inside>.cmb_metabox{margin:-10px 0}.cmb_metabox .cmb-row{overflow:hidden;margin:0 -5px;zoom:1}.cmb_metabox .cmb-row:after,.cmb_metabox .cmb-row:before{content:"";display:table}.cmb_metabox .cmb-row:after{clear:both}.cmb_metabox [class*=cmb-cell-]{float:left;padding:0 5px;-moz-box-sizing:border-box;box-sizing:border-box}.cmb_metabox .cmb-cell-1{width:8.333333333%}.cmb_metabox .cmb-cell-2{width:16.666666667%}.cmb_metabox .cmb-cell-3{width:25%}.cmb_metabox .cmb-cell-4{width:33.333333333%}.cmb_metabox .cmb-cell-5{width:41.666666667%}.cmb_metabox .cmb-cell-6{width:50%}.cmb_metabox .cmb-cell-7{width:58.333333333%}.cmb_metabox .cmb-cell-8{width:66.666666667%}.cmb_metabox .cmb-cell-9{width:75%}.cmb_metabox .cmb-cell-10{width:83.333333333%}.cmb_metabox .cmb-cell-11{width:91.666666667%}.cmb_metabox .cmb-cell-12{width:100%}@media all and (max-width:850px){.cmb_metabox [class*=cmb-cell-]{width:100%}}@media all and (min-width:850px){.cmb_metabox [class*=cmb-cell-].cmb-has-label+.cmb-no-label{padding-top:32px}}.cmb_metabox .field-item{position:relative}.cmb_metabox_description{color:#AAA;font-style:italic;margin:0 0 16px!important}.cmb_metabox input[type=text],.cmb_metabox select,.cmb_metabox textarea{width:100%;margin:0}.cmb_metabox input.cmb_text_small{width:100px}.cmb_metabox input.cmb_text_medium{width:230px;margin-right:15px}.cmb_metabox input[type=checkbox],.cmb_metabox input[type=radio]{margin:0 5px 0 0;padding:0}.cmb_metabox .field-title{margin-bottom:16px;margin-top:0;font-weight:700}.cmb_metabox .field-title label{vertical-align:baseline}.cmb_metabox .select2-search-choice-close{-webkit-transition:none;transition:none;top:3px}.cmb_metabox [disabled]{background:#F7F7F7}.cmb_metabox .field.repeatable>.field-item{padding-right:30px;margin-bottom:10px}.cmb_metabox .repeat-field{display:block!important;clear:both}.CMB_Date_Field.repeatable .field-item,.CMB_Date_Timestamp_Field.repeatable .field-item,.CMB_Datetime_Timestamp_Field.repeatable .field-item,.CMB_Text_Small_Field.repeatable .field-item,.CMB_Time_Field.repeatable .field-item{float:left;clear:both}.cmb-delete-field{display:inline-block;text-decoration:none;font-size:11px;line-height:20px;height:22px;width:22px;margin:0;padding:0;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top;position:absolute;top:3px;right:0;text-indent:100%;overflow:hidden;white-space:nowrap}.cmb-delete-field:active,.cmb-delete-field:focus,.cmb-delete-field:hover{background:#fafafa;border-color:#999;color:#222}.cmb-delete-field .cmb-delete-field-icon{content:' ';display:block;position:absolute;height:8px;width:8px;top:50%;left:50%;margin-top:-4px;margin-left:-4px;background-image:url( '../../images/cmb-icon-remove.png');background-repeat:no-repeat;text-indent:8px;overflow:hidden}@media only screen and (-webkit-min-device-pixel-ratio :1.5),only screen and (min-device-pixel-ratio :1.5){.cmb-delete-field .cmb-delete-field-icon{background-image:url( '../../images/cmb-icon-remove@2x.png');background-size:8px 8px}}.cmb-sortable>.field-item{padding-left:15px}.cmb-sortable .cmb-handle{height:100%;width:3px;position:absolute;top:0;left:0;background:0 0;cursor:move;border-left:3px solid #DFDFDF;border-right:3px solid #DFDFDF}.cmb-sortable .ui-sortable-helper{opacity:.75}.cmb-sortable .ui-sortable-helper:before{content:' ';position:absolute;width:100%;height:100%;top:-6px;left:-6px;background-color:#F8F8F8;border:1px solid #DEDEDE;padding:5px;z-index:-1}.cmb-sortable>.ui-sortable-placeholder{border:1px dashed #DDD!important;background:transparent!important;visibility:visible!important;margin-bottom:8px!important}.cmb_metabox .CMB_Group_Field>.field-title{font-size:20px;clear:left;color:#222;font-family:'Open Sans',sans-serif;font-weight:400;margin:8px 0}.cmb_metabox .CMB_Group_Field.repeatable>.field-title{margin-bottom:16px}.cmb_metabox .CMB_Group_Field.repeatable>.field-item{padding:30px 10px 0;margin-bottom:16px;border:1px solid #DDD;background:#FAFAFA;position:relative}.cmb_metabox .CMB_Group_Field.repeatable>.field-item:before{content:' ';display:block;position:absolute;top:0;left:0;right:0;height:33px;border-bottom:1px solid #DDD}.cmb_metabox .CMB_Group_Field.repeatable>.field-item>.cmb-delete-field{top:5px;right:5px;width:auto;text-indent:0;padding-left:24px;padding-right:8px;height:22px;line-height:20px;font-size:11px;z-index:1}.cmb_metabox .CMB_Group_Field.repeatable>.field-item>.cmb-delete-field .cmb-delete-field-icon{left:12px}.CMB_Group_Field.cmb-sortable>.field-item{position:relative;padding-top:30px}.CMB_Group_Field.cmb-sortable>.field-item>.cmb-handle{top:-1px;left:-1px;right:-1px;height:34px;width:auto;border:0;border-bottom:1px solid #DDD}.CMB_Group_Field.cmb-sortable>.field-item.ui-sortable-helper>.cmb-handle{padding:0 5px}.cmb_metabox .CMB_Group_Field.repeatable.cmb-sortable>.field-item:before{display:none!important}.CMB_Group_Field.cmb-sortable>.ui-sortable-placeholder{margin-bottom:16px!important}.CMB_Group_Field .cmb_metabox>.cmb-row:last-child{margin-bottom:0}.CMB_File_Field .field-item,.CMB_Image_Field .field-item{float:left;margin:0 16px 16px 0!important;text-align:center;padding:0!important;z-index:1}.cmb-file-wrap{position:relative;overflow:hidden;width:150px;height:150px;line-height:150px}.cmb-file-wrap-placeholder{content:' ';position:absolute;top:0;left:0;display:block;height:142px;width:142px;border:4px dashed #DDD;z-index:-1}.cmb-file-wrap-placeholder .dimensions{line-height:normal;position:absolute;bottom:10px;right:10px;font-size:18px;font-weight:700;opacity:.2}.cmb-file-holder{position:relative;overflow:hidden;box-shadow:inset 0 0 15px rgba(0,0,0,.1),inset 0 0 0 1px rgba(0,0,0,.05);background:#eee;width:100%;height:100%}.cmb-file-holder.type-file img{position:absolute;top:43%;margin-top:-30px;left:50%;margin-left:-23px}.cmb-file-holder.type-img img{width:100%;height:auto;margin-top:0;vertical-align:top}.cmb-file-holder.type-img::after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);overflow:hidden;z-index:1}.cmb-file-name{position:absolute;left:0;right:0;bottom:0;line-height:1.4;overflow:hidden;max-height:100%;word-wrap:break-word;text-align:center;font-weight:700;background:rgba(255,255,255,.8);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}.cmb-file-name strong{padding:5px 10px;display:block}.CMB_File_Field .cmb-delete-field,.CMB_Image_Field .cmb-delete-field{z-index:10;top:10px;right:10px}.CMB_File_Field .cmb-remove-file,.CMB_Image_Field .cmb-remove-file{position:absolute;z-index:1;top:5px;right:5px}.CMB_File_Field.repeatable .cmb-remove-file,.CMB_Image_Field.repeatable .cmb-remove-file{display:none!important}.cmb-file-wrap .cmb-file-upload{vertical-align:middle}.cmb-loading::before{content:' ';display:block;background:url( '../../images/wpspin.gif' ) no-repeat;width:16px;height:16px;position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}@media only screen and (-webkit-min-device-pixel-ratio :1.5),only screen and (min-device-pixel-ratio :1.5){.cmb-loading::before{background-image:url( '../../images/wpspin-2x.gif');background-size:16px 16px}}.CMB_File_Field.cmb-sortable .cmb-handle,.CMB_Image_Field.cmb-sortable .cmb-handle{border:0;background:0 0;height:100%;width:100%;z-index:1}.CMB_File_Field.cmb-sortable .cmb-file-upload,.CMB_Image_Field.cmb-sortable .cmb-file-upload{position:relative;z-index:5}.CMB_File_Field.cmb-sortable .ui-sortable-helper:before,.CMB_Image_Field.cmb-sortable .ui-sortable-helper:before{top:0;left:0;padding:0;border:0;background:#F9F9F9}.CMB_Title .field-title{margin:8px 0!important}.CMB_Title{border-bottom:0;padding-bottom:0;margin-top:16px}.CMB_Title h2{margin:0!important;padding:0!important}.CMB_Color_Picker .field-item{float:left;clear:both}.CMB_Color_Picker:after,.CMB_Color_Picker:before{content:"";display:table}.CMB_Color_Picker:after{clear:both}.CMB_Color_Picker{zoom:1}div.time-picker{position:absolute;height:191px;width:4em;overflow:auto;background:#fff;border:1px solid #aaa;z-index:99;margin:0}div.time-picker-12hours{width:6em}div.time-picker ul{list-style-type:none;margin:0;padding:0}div.time-picker li{cursor:pointer;height:10px;font:12px/1 Helvetica,Arial,sans-serif;padding:4px 3px}div.time-picker li.selected{background:#0063CE;color:#fff}.cmb_metabox input.cmb_timepicker{width:100px;margin-right:0}.CMB_Datetime_Timestamp_Field input+input{margin-left:4px}.cmb_select{width:100%}.select2-offscreen{display:none} \ No newline at end of file diff --git a/css/src/layout.css b/css/src/layout.css index ded6137c..04d01502 100644 --- a/css/src/layout.css +++ b/css/src/layout.css @@ -1,23 +1,23 @@ /** CMB Layout **/ -.cmb_metabox .field { +.cmb_metabox .field { overflow: hidden; padding: 16px 0; border-bottom: 1px solid #DFDFDF; } -.cmb-row:last-child > [class*="cmb-cell-"] > .field { - border-bottom: 0; +.cmb-row:last-child > [class*="cmb-cell-"] > .field { + border-bottom: 0; } /* Neaten up the margins when metaboxes are within the standard postbox. */ .postbox > .inside > .cmb_metabox { - margin: -10px 0; + margin: -10px 0; } -.cmb_metabox .cmb-row { - overflow: hidden; - margin: 0 -5px; +.cmb_metabox .cmb-row { + overflow: hidden; + margin: 0 -5px; zoom: 1; } @@ -25,13 +25,13 @@ .cmb_metabox .cmb-row:after { content: ""; display: table; -} +} .cmb_metabox .cmb-row:after { clear: both; } -.cmb_metabox [class*="cmb-cell-"] { - float: left; +.cmb_metabox [class*="cmb-cell-"] { + float: left; padding: 0 5px; -moz-box-sizing: border-box; box-sizing: border-box; @@ -55,3 +55,9 @@ .cmb_metabox [class*="cmb-cell-"] { width: 100%; } } + +@media all and ( min-width: 850px ) { + + .cmb_metabox [class*="cmb-cell-"].cmb-has-label + .cmb-no-label { padding-top: 32px } + +} From ccf5e1bd6c310c4683f22ac580e73595c33bfc45 Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Fri, 15 Jul 2016 17:11:36 +0200 Subject: [PATCH 2/5] Added PHP 5.6, 7.0, and trying 5.2 --- .travis.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1772addd..79aaf591 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,12 @@ language: php php: - - 5.2 - - 5.3 - - 5.4 - - 5.5 + - '5.2' + - '5.3' + - '5.4' + - '5.5' + - '5.6' + - '7.0' - hhvm env: From e07c3ae16f8528235ab3b0423d6c2e82d95bd3e9 Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Fri, 15 Jul 2016 17:26:54 +0200 Subject: [PATCH 3/5] Removing PHP 5.2 support because Travis doesn't support it --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 79aaf591..e0b7b758 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,11 @@ language: php php: - - '5.2' - - '5.3' - - '5.4' - - '5.5' - - '5.6' - - '7.0' + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - 7.0 - hhvm env: From 1de7f606e56f936d7e035e97f89c200f842dbbda Mon Sep 17 00:00:00 2001 From: Mike Selander Date: Fri, 15 Jul 2016 17:36:43 +0200 Subject: [PATCH 4/5] Added exclusions for hhvm and 7.0 for faster runtime and fixing issues with 3.8 & PHP 7 --- .travis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.travis.yml b/.travis.yml index e0b7b758..ab1afeaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,22 @@ env: - WP_VERSION=3.8 WP_MULTISITE=0 - WP_VERSION=3.8 WP_MULTISITE=1 +matrix: + allow_failures: + - php: hhvm + fast_finish: true + exclude: + # Only test latest version of WP with HHVM + - php: hhvm + env: WP_VERSION=3.8 WP_MULTISITE=0 + - php: hhvm + env: WP_VERSION=3.8 WP_MULTISITE=1 + # Only test latest version of WP with PHP 7.0 because 3.8 won't work at all + - php: 7.0 + env: WP_VERSION=3.8 WP_MULTISITE=0 + - php: 7.0 + env: WP_VERSION=3.8 WP_MULTISITE=1 + before_script: - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION From 6838f7b9d947260d4dfbfc39275b944857847830 Mon Sep 17 00:00:00 2001 From: Barry Ceelen Date: Mon, 29 Aug 2016 02:05:57 +0200 Subject: [PATCH 5/5] Use $this->get_value() in CMB_Number_Field --- classes.fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes.fields.php b/classes.fields.php index bc9238f7..dee15239 100644 --- a/classes.fields.php +++ b/classes.fields.php @@ -649,7 +649,7 @@ public function get_default_args() { public function html() { ?> - id_attr(); ?> boolean_attr(); ?> class_attr( 'cmb_text_number code' ); ?> name_attr(); ?> value="value ); ?>" /> + id_attr(); ?> boolean_attr(); ?> class_attr( 'cmb_text_number code' ); ?> name_attr(); ?> value="get_value() ); ?>" />