Skip to content

Commit

Permalink
fixed grid around submit button (sulu#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored and wachterjohannes committed Nov 14, 2017
1 parent 4151ab9 commit f46ab30
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
| Q | A
| --- | ---
| Bug? | no
| New Feature? | no
| Bundle Version | Specific version or SHA of a commit
| Sulu Version | Specific version or SHA of a commit
| Browser Version | Browser name and version

#### Actual Behavior

How does it behave at the moment?

#### Expected Behavior

What is the behavior you expect?

#### Steps to Reproduce

What are the steps to reproduce this bug? Please add code examples,
screenshots or links to GitHub repositories that reproduce the problem.

#### Possible Solutions

If you have already ideas how to solve the issue, add them here.
(remove this section if not needed)

39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
| Q | A
| --- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Fixed tickets | fixes #issuenum
| Related issues/PRs | #issuenum
| License | MIT

#### What's in this PR?

Explain the contents of the PR.

#### Why?

Which problem does the PR fix? (remove this section if you linked an issue above)

#### Example Usage

```php
// If you added new features, show examples of how to use them here
// (remove this section if not a new feature)

$foo = new Foo();

// Now we can do
$foo->doSomething();
```

#### BC Breaks/Deprecations

Describe BC breaks/deprecations here. (remove this section if not needed)

#### To Do

- [ ] Update CHANGELOG.md
- [ ] Create documentation

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.4.0 (unreleased)

- FEATURE #114 Fixed grid around submit button
- FEATURE #113 Fixed last width when next has no place
- FEATURE #109 Add symfony 3 to test runs
- FEATURE #108 Add widths to bundle configuration
Expand Down
16 changes: 14 additions & 2 deletions Form/Type/DynamicFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,19 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);

// Add submit button.
$builder->add('submit', SubmitType::class, ['label' => $translation->getSubmitLabel()]);
$builder->add(
'submit',
SubmitType::class,
[
'label' => $translation->getSubmitLabel(),
'attr' => [
'width' => 'full',
'widthNumber' => $this->getItemWidthNumber('full'),
'lastWidth' => true,
'placeholder' => '',
],
]
);
}

/**
Expand Down Expand Up @@ -236,7 +248,7 @@ private function getLastWidth(&$currentWidthValue, $width, $nextWidth)
return true;
}

// if next has no place in current row current is last width
// if next item has no space in current row the current item is last
if (($currentWidthValue % 12) + $nextWidthNumber > 12) {
$currentWidthValue += 12 - $currentWidthValue % 12;

Expand Down

0 comments on commit f46ab30

Please sign in to comment.