1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-22 22:34:15 +02:00

Make PageTable buttons have better margins per processwire/processwire-issues#521

This commit is contained in:
Ryan Cramer
2018-03-14 08:43:56 -04:00
parent 11398f00bf
commit 1045acc057
3 changed files with 9 additions and 1 deletions

View File

@@ -103,7 +103,7 @@ class FieldtypeOptions extends FieldtypeMulti implements Module {
if($field->initValue) { if($field->initValue) {
$value = $page->getUnformatted($field->name); $value = $page->getUnformatted($field->name);
if($field->required && !$field->requiredIf) { if($field->required && !$field->requiredIf) {
if(empty($value) || !count($value)) { if(empty($value) || !wireCount($value)) {
$page->set($field->name, $field->initValue); $page->set($field->name, $field->initValue);
} }
} else if($this->wire('process') != 'ProcessField' && !wireCount($value)) { } else if($this->wire('process') != 'ProcessField' && !wireCount($value)) {

View File

@@ -45,3 +45,10 @@
margin-bottom: 0; margin-bottom: 0;
} }
small .InputfieldPageTableAdd {
display: inline-block;
margin: 0 3px 3px 0;
}
.InputfieldPageTable small .InputfieldPageTableAdd button {
margin: 0;
}

View File

@@ -150,6 +150,7 @@ class InputfieldPageTable extends Inputfield {
if($this->nameFormat) $url .= "&name_format=" . $this->wire('sanitizer')->entities($this->nameFormat); if($this->nameFormat) $url .= "&name_format=" . $this->wire('sanitizer')->entities($this->nameFormat);
$btn .= "<span class='InputfieldPageTableAdd' data-url='$url'>" . $button->render() . "</span>"; $btn .= "<span class='InputfieldPageTableAdd' data-url='$url'>" . $button->render() . "</span>";
} }
if(count($this->rowTemplates) > 1) $btn = "<small>$btn</small>";
$out .= "<div class='InputfieldPageTableButtons ui-helper-clearfix'>$btn</div>"; $out .= "<div class='InputfieldPageTableButtons ui-helper-clearfix'>$btn</div>";
if(!$this->wire('input')->get('InputfieldPageTableField')) { if(!$this->wire('input')->get('InputfieldPageTableField')) {