mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-27 04:10:30 +08:00
Implemented data-form support.
This commit is contained in:
@@ -56,6 +56,7 @@ Yii Framework 2 Change Log
|
||||
- Enh #10061: `yii\helpers\BaseInflector::transliterate()` is now public. Introduced different levels of transliteration strictness (silverfire)
|
||||
- Enh #10118: Allow easy extension of slug generation in `yii\behaviors\SluggableBehavior` (cebe, hesna)
|
||||
- Enh: Added last resort measure for `FileHelper::removeDirectory()` fail to unlink symlinks under Windows (samdark)
|
||||
- Enh: #9893: Added support for data-form attribute so links can target specific forms (SamMousa)
|
||||
- Chg #9369: `Yii::$app->user->can()` now returns `false` instead of erroring in case `authManager` component is not configured (creocoder)
|
||||
- Chg #9411: `DetailView` now automatically sets container tag ID in case it's not specified (samdark)
|
||||
- Chg #9953: `TimestampBehavior::getValue()` changed to make value processing consistent with `AttributeBehavior::getValue()` (silverfire)
|
||||
|
||||
@@ -144,8 +144,8 @@ yii = (function ($) {
|
||||
* @param $e the jQuery representation of the element
|
||||
*/
|
||||
handleAction: function ($e, event) {
|
||||
var method = $e.data('method'),
|
||||
$form = $e.closest('form'),
|
||||
var $form = $e.attr('data-form') ? $('#' + $e.attr('data-form')) : $e.closest('form'),
|
||||
method = !$e.data('method') && $form ? $form.attr('method') : $e.data('method'),
|
||||
action = $e.attr('href'),
|
||||
params = $e.data('params'),
|
||||
pjax = $e.data('pjax'),
|
||||
@@ -322,9 +322,10 @@ yii = (function ($) {
|
||||
var handler = function (event) {
|
||||
var $this = $(this),
|
||||
method = $this.data('method'),
|
||||
message = $this.data('confirm');
|
||||
message = $this.data('confirm'),
|
||||
form = $this.data('form');
|
||||
|
||||
if (method === undefined && message === undefined) {
|
||||
if (method === undefined && message === undefined && form === undefined) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user