Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Commit

Permalink
- Renamed buttons functions due to conflict with kdyby/replicator-form
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Jun 9, 2015
1 parent ec285bb commit 8c10c98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/IPub/FormsBlocks/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public static function register($methodName = 'addBlocks')
return;
}

Controls\SubmitButton::extensionMethod('addRemoveOnClick', function (Controls\SubmitButton $_this, $callback = NULL) {
Controls\SubmitButton::extensionMethod('addRemoveBlockOnClick', function (Controls\SubmitButton $_this, $callback = NULL) {
$_this->setValidationScope(FALSE);
$_this->onClick[] = function (Controls\SubmitButton $button) use ($callback) {
$blocks = $button->lookup(__NAMESPACE__ . '\Container');
Expand All @@ -584,7 +584,7 @@ public static function register($methodName = 'addBlocks')
return $_this;
});

Controls\SubmitButton::extensionMethod('addCreateOnClick', function (Controls\SubmitButton $_this, $allowEmpty = FALSE, $callback = NULL) {
Controls\SubmitButton::extensionMethod('addCreateBlockOnClick', function (Controls\SubmitButton $_this, $allowEmpty = FALSE, $callback = NULL) {
$_this->onClick[] = function (Controls\SubmitButton $button) use ($allowEmpty, $callback) {
$blocks = $button->lookup(__NAMESPACE__ . '\Container');

Expand Down
4 changes: 2 additions & 2 deletions tests/IPubTests/FormsBlocks/ContainerTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class ContainerTest extends Tester\TestCase
'do' => 'form-submit'
]);

$blocks['add']->addCreateOnClick();
$blocks['add']->addCreateBlockOnClick();

Assert::false($blocks->isAllFilled());
}
Expand Down Expand Up @@ -200,7 +200,7 @@ class ContainerTest extends Tester\TestCase
'do' => 'form-submit'
]);

$blocks['add']->addCreateOnClick();
$blocks['add']->addCreateBlockOnClick();

Assert::true($blocks->isAllFilled());
}
Expand Down

0 comments on commit 8c10c98

Please sign in to comment.