Skip to content

Commit

Permalink
#2173, form does not allow immediate invocation of behaviors in 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Apr 27, 2015
1 parent ec853a6 commit 04c4fde
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/definitions/behaviors/form.js
Expand Up @@ -48,7 +48,6 @@ $.fn.form = function(parameters) {
settings,
validation,

namespace,
metadata,
selector,
className,
Expand All @@ -68,8 +67,10 @@ $.fn.form = function(parameters) {

// settings grabbed at run time
module.get.settings();

if(methodInvoked) {
if(instance === undefined) {
module.instantiate();
}
module.invoke(query);
}
else {
Expand Down Expand Up @@ -342,8 +343,8 @@ $.fn.form = function(parameters) {
}
else {
// 2.x
settings = $.extend(true, {}, $.fn.form.settings, parameters),
validation = $.extend({}, $.fn.form.settings.defaults, settings.fields),
settings = $.extend(true, {}, $.fn.form.settings, parameters);
validation = $.extend({}, $.fn.form.settings.defaults, settings.fields);
module.verbose('Extending settings', validation, settings);
}
}
Expand Down Expand Up @@ -441,7 +442,7 @@ $.fn.form = function(parameters) {
}
if(isCheckbox) {
if(isChecked) {
values[name].push(value)
values[name].push(value);
}
else {
module.debug('Omitted unchecked checkbox', $field);
Expand Down Expand Up @@ -949,7 +950,7 @@ $.fn.form.settings = {
name : 'Form',
namespace : 'form',

debug : false,
debug : true,
verbose : false,
performance : true,

Expand Down Expand Up @@ -1066,7 +1067,7 @@ $.fn.form.settings = {

// is not empty or blank string
empty: function(value) {
return !(value === undefined || '' === value || $.isArray(value) && value.length == 0);
return !(value === undefined || '' === value || $.isArray(value) && value.length === 0);
},

// is valid integer
Expand Down

0 comments on commit 04c4fde

Please sign in to comment.