Skip to content

Example Custom Sync Views with Coffee

Cahyadi Triyansyah edited this page Jul 20, 2018 · 1 revision

This improvement for Custom Sync Views and javascript hooks

class RenderSync.TodoListRow extends RenderSync.View
  beforeInsert: ($el) ->
    $el.hide()
    @insert($el)

  afterInsert: ->
    @$el.fadeIn 'slow'

  afterUpdate: ($el) ->
    @$el.fadeOut 'slow', ->
      $(this).html($el).fadeIn 'slow'

  beforeRemove: ->
    @$el.fadeOut 'slow', => @remove()
Clone this wiki locally