From 80cc9cc16fc49433eb80b017c08252a08f114fa4 Mon Sep 17 00:00:00 2001 From: usualdesigner Date: Mon, 20 Oct 2014 23:56:39 +0300 Subject: [PATCH] Basic implementation of the data-params attributes --- framework/assets/yii.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/assets/yii.js b/framework/assets/yii.js index 6617a65..5476347 100644 --- a/framework/assets/yii.js +++ b/framework/assets/yii.js @@ -126,7 +126,8 @@ yii = (function ($) { handleAction: function ($e) { var method = $e.data('method'), $form = $e.closest('form'), - action = $e.attr('href'); + action = $e.attr('href'), + params = $e.data('params'); if (method === undefined) { if (action && action != '#') { @@ -157,6 +158,11 @@ yii = (function ($) { if (csrfParam) { $form.append(''); } + if (params && $.isPlainObject(params)) { + $.each(params, function (idx, obj) { + $form.append(''); + }); + } } $form.hide().appendTo('body'); }