より多くのコンテキストで編集されました。$CONSTRUCTOR = passed_in の場合、Firefox と Chrome で「passed_in はコンストラクタではありません」とスローされます。$CONSTRUCTOR = not_passed_in の場合、
initialize: (options) ->
@collection.bind 'all', @render
$('.search_box').parent('form').submit (event) =>
@loading()
event.preventDefault()
query = $(event.target).find('.search_box').val()
window.app.navigate('?query=' + query, trigger: true)
passed_in = PaginationView
@render(passed_in)
render: (passed_in)=>
if @collection.isEmpty() && @collection.query
@$el.html(JST['users/no_results'](query: @collection.query))
else if @collection.isEmpty() # Not loaded yet
@$el.html("<div class='loading'></div>")
else
html = JST['users/user_list'](@viewData())
@$el.html(html)
for user in @collection.models
html = new UserListItemView(model: user).render().el
@$('tbody.users').append(html)
not_passed_in = PaginationView
new $CONSTRUCTOR(
type: "user"
el: @$('.paginate')
model: @collection
data: {}
onError: @onError
).bind('change', @loading)
これは CoffeeScript の既知の (バグ|機能) ですか? それとも私は何か間違ったことをしていますか?
(これらは Backbone.coffee ビューにあります。関連性があるとは思えません)