ES5 one-var

This commit is contained in:
Amine Ben hammou
2017-09-25 09:39:00 +00:00
parent a11d6d7868
commit c3ea088fca
27 changed files with 584 additions and 593 deletions

View File

@ -23,21 +23,21 @@ define(
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
$.fn.serializeObject = function (coerce) {
var obj = {},
coerce_types = { true: !0, false: !1, null: null };
$.fn.serializeObject = function(coerce) {
var obj = {};
var coerce_types = { true: !0, false: !1, null: null };
// Iterate over all name=value pairs.
$.each(this.serializeArray(), function (j, v) {
var key = v.name,
val = v.value,
cur = obj,
i = 0,
$.each( this.serializeArray(), function(j, v){
var key = v.name;
var val = v.value;
var cur = obj;
var i = 0;
// If key is more complex than 'foo', like 'a[]' or 'a[b][c]', split it
// into its component parts.
keys = key.split(']['),
keys_last = keys.length - 1;
// If key is more complex than 'foo', like 'a[]' or 'a[b][c]', split it
// into its component parts.
var keys = key.split( '][' );
var keys_last = keys.length - 1;
// If the first keys part contains [ and the last ends with ], then []
// are correctly balanced.
@ -106,4 +106,4 @@ define(
return $;
}
);
);