mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Merge branch 'SamMousa-enh-link-submission-form-attribute-9893'
This commit is contained in:
@ -8,6 +8,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #10850: Fixed unable to use 'definitions' and 'aliases' at `yii\widgets\MaskedInput` (rahimov, klimov-paul)
|
||||
- Bug #10946: Fixed parameters binding to the SQL query in `yii\db\mysqlSchema::findConstraints()` (silverfire)
|
||||
- Enh #5469: Add mimetype validation by mask in FileValidator (kirsenn, samdark, silverfire)
|
||||
- Enh #9893: `yii.js` handleAction enhanced to support for data-form attribute, so links can trigger specific forms (SamMousa)
|
||||
- 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 #10451: Check of existence of `$_SERVER` in `\yii\web\Request` before using it (quantum13)
|
||||
- Enh #10610: Added `BaseUrl::$urlManager` to be able to set URL manager used for creating URLs (samdark)
|
||||
|
@ -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'),
|
||||
@ -345,9 +345,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