Merge branch 'AnatolyRugalev-issue-10322'

This commit is contained in:
SilverFire - Dmitry Naumenko
2016-04-25 23:58:06 +03:00
2 changed files with 11 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ Yii Framework 2 Change Log
- Enh #9562: Adds `char` datatype to framework (df2) - Enh #9562: Adds `char` datatype to framework (df2)
- Enh #9604: `yii\db\BaseActiveRecord` now triggers event `EVENT_AFTER_REFRESH` after a record is refreshed (raoul2000) - Enh #9604: `yii\db\BaseActiveRecord` now triggers event `EVENT_AFTER_REFRESH` after a record is refreshed (raoul2000)
- Enh #9893: `yii.js` handleAction enhanced to support for data-form attribute, so links can trigger specific forms (SamMousa) - Enh #9893: `yii.js` handleAction enhanced to support for data-form attribute, so links can trigger specific forms (SamMousa)
- Enh #10322: ActiveForm now respects formtarget attribute of submit button (AnatolyRugalev)
- Enh #10451: Check of existence of `$_SERVER` in `\yii\web\Request` before using it (quantum13) - Enh #10451: Check of existence of `$_SERVER` in `\yii\web\Request` before using it (quantum13)
- Enh #10487: `yii\helpers\BaseArrayHelper::index()` got a third parameter `$groupBy` to group the input array by the key in one or more dimensions (quantum13, silverfire, samdark) - Enh #10487: `yii\helpers\BaseArrayHelper::index()` got a third parameter `$groupBy` to group the input array by the key in one or more dimensions (quantum13, silverfire, samdark)
- Enh #10610: Added `BaseUrl::$urlManager` to be able to set URL manager used for creating URLs (samdark) - Enh #10610: Added `BaseUrl::$urlManager` to be able to set URL manager used for creating URLs (samdark)
@@ -211,6 +212,7 @@ Yii Framework 2 Change Log
- Enh #10783: Added migration and unit-tests for `yii\i18n\DbMessageSource` (silverfire) - Enh #10783: Added migration and unit-tests for `yii\i18n\DbMessageSource` (silverfire)
- Enh #10797: Cleaned up requirements checker CSS (muhammadcahya) - Enh #10797: Cleaned up requirements checker CSS (muhammadcahya)
- Enh #11336: Allow resettting `$hostInfo`, `$scriptUrl`, and `$pathInfo` in `yii\web\Request` and `$baseUrl`, and `$hostInfo` in `yii\web\UrlManager` to `null`, to make Yii determine the value again (cebe) - Enh #11336: Allow resettting `$hostInfo`, `$scriptUrl`, and `$pathInfo` in `yii\web\Request` and `$baseUrl`, and `$hostInfo` in `yii\web\UrlManager` to `null`, to make Yii determine the value again (cebe)
- Enh #10322: `yii.activeForm.js` now respects the `formtarget` attribute of submit button (anatolyrugalev)
- Enh: Added last resort measure for `FileHelper::removeDirectory()` fail to unlink symlinks under Windows (samdark) - Enh: Added last resort measure for `FileHelper::removeDirectory()` fail to unlink symlinks under Windows (samdark)
- Enh: `AttributeBehavior::getValue()` now respects the callable in array format (silverfire) - Enh: `AttributeBehavior::getValue()` now respects the callable in array format (silverfire)
- Chg #6419: Added `yii\web\ErrorHandler::displayVars` make list of displayed vars customizable. `$_ENV` and `$_SERVER` are not displayed by default anymore (silverfire) - Chg #6419: Added `yii\web\ErrorHandler::displayVars` make list of displayed vars customizable. `$_ENV` and `$_SERVER` are not displayed by default anymore (silverfire)

View File

@@ -201,7 +201,8 @@
settings: settings, settings: settings,
attributes: attributes, attributes: attributes,
submitting: false, submitting: false,
validated: false validated: false,
target: $form.attr('target')
}); });
/** /**
@@ -575,7 +576,14 @@
data.submitting = false; data.submitting = false;
} else { } else {
data.validated = true; data.validated = true;
var buttonTarget = data.submitObject ? data.submitObject.attr('formtarget') : null;
if (buttonTarget) {
// set target attribute to form tag before submit
$form.attr('target', buttonTarget);
}
$form.submit(); $form.submit();
// restore original target attribute value
$form.attr('target', data.target);
} }
} else { } else {
$.each(data.attributes, function () { $.each(data.attributes, function () {