src/joosy/extensions/resources-form/form.coffee in joosy-1.2.0.alpha.37 vs src/joosy/extensions/resources-form/form.coffee in joosy-1.2.0.alpha.38
- old
+ new
@@ -38,11 +38,11 @@
substitutions: {}
#
# List of elements for internal usage
#
- elements:
+ @mapElements
'fields': 'input,select,textarea'
#
# Makes one AJAX request with form data without binding
#
@@ -102,11 +102,11 @@
@[key] = value
@container = $(form)
return if @container.length == 0
- @refreshElements()
+ @__assignElements()
@__delegateEvents()
method = @container.get(0).getAttribute('method')?.toLowerCase()
if method && !['get', 'post'].any method
@__markMethod method
@@ -177,11 +177,11 @@
filler = (data, scope) =>
return if data.__joosy_form_filler_lock
data.__joosy_form_filler_lock = true
Object.each data, (property, val) =>
key = @concatFieldName scope, property
- input = @$fields.filter("[name='#{key}']:not(:file),[name='#{key.underscore()}']:not(:file),[name='#{key.camelize(false)}']:not(:file)")
+ input = @$fields("[name='#{key}']:not(:file),[name='#{key.underscore()}']:not(:file),[name='#{key.camelize(false)}']:not(:file)")
if input.length > 0
if input.is ':checkbox'
if val
input.attr 'checked', 'checked'
else
@@ -244,11 +244,11 @@
# Inner before callback.
# By default will clean invalidation.
#
__before: (xhr, settings) ->
if !@before? || @before(arguments...) is true
- @$fields.removeClass @invalidationClass
+ @$fields().removeClass @invalidationClass
#
# Inner error callback.
# By default will trigger basic invalidation.
#
@@ -290,10 +290,10 @@
# or monkeypatch it from time to time
#
# @param [String] field Name of field to find
#
findField: (field) ->
- @$fields.filter("[name='#{field}']")
+ @$fields("[name='#{field}']")
#
# Simulates REST methods by adding hidden _method input with real method
# while setting POST as the transport method
#