Rewrite filter-input to HTMLBars

This commit is contained in:
Piotr Sarnacki 2015-03-24 15:14:47 +01:00
parent 3356b4367a
commit 4d5884c42b
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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`