Rewrite filter-input to HTMLBars
This commit is contained in:
parent
3356b4367a
commit
4d5884c42b
|
@ -15,7 +15,7 @@ Ember.HTMLBars._registerHelper('travis-field', travisField)
|
|||
Ember.HTMLBars._registerHelper('travis-errors', travisErrors)
|
||||
Ember.Handlebars.registerHelper('tipsy', tipsy)
|
||||
#Ember.Handlebars.registerHelper('input', input)
|
||||
Ember.Handlebars.registerHelper('filter-input', filterInput)
|
||||
Ember.HTMLBars._registerHelper('filter-input', filterInput)
|
||||
Ember.Handlebars.registerBoundHelper('mb', mb)
|
||||
|
||||
Ember.MODEL_FACTORY_INJECTIONS = true
|
||||
|
|
|
@ -7,12 +7,12 @@ TextField = Ember.TextField.extend
|
|||
_elementValueDidChange: ->
|
||||
@set('_value', @$().val());
|
||||
|
||||
fn = (options) ->
|
||||
Ember.assert('You can only pass attributes to the `input` helper, not arguments', arguments.length < 2)
|
||||
fn = (params, hash, options, env) ->
|
||||
Ember.assert('You can only pass attributes to the `input` helper, not arguments', params.length)
|
||||
|
||||
onEvent = options.hash.on
|
||||
delete options.hash.on
|
||||
options.hash.onEvent = onEvent || 'enter'
|
||||
return Ember.Handlebars.helpers.view.call(this, TextField, options)
|
||||
onEvent = hash.on
|
||||
delete hash.on
|
||||
hash.onEvent = onEvent || 'enter'
|
||||
env.helpers.view.helperFunction.call(this, [TextField], hash, options, env)
|
||||
|
||||
`export default fn`
|
||||
|
|
Loading…
Reference in New Issue
Block a user