evil-blocks
evil-blocks copied to clipboard
Self triggering events
I have a proposal to extend events binding syntax with following:
'change on @countrySelect!': ->
Event with !
on the end of declaration, should be triggered right after binding.
This should be helpful for events like:
'resize on window!':->
@block.width $(window).width() / 2
or
'change on @countrySelect!': ->
@populateCitySelect(@countries[@countrySelect.val()].cities)
for quick setup initial values.
Yeap, we need it ut maybe we should use more understandable syntax?
'init resize on window':->
or
'now resize on window':->
But here we block to use init
event. So maybe:
'resize on window and init':->