Sha256: b56909a00651b671006869805bc49990ba270d259fa91b9dee1982e83bc76345
Contents?: true
Size: 856 Bytes
Versions: 3
Compression:
Stored size: 856 Bytes
Contents
#= require cmsimple/models/page #= require cmsimple/models/path #= require cmsimple/views/redirects/_path class CMSimple.Panels.Redirects.List extends Spine.Controller events: 'click a.remove' : 'destroy' constructor: (el)-> super el: $(el) CMSimple.Path.bind 'refresh change', => @render() refresh: -> # TODO: should this be a model method? if CMSimple.Page.count() > 1 CMSimple.Path.fetch() else CMSimple.Page.one 'refresh', -> CMSimple.Path.fetch() CMSimple.Page.fetch() render: -> @html('') @addPath path for path in CMSimple.Path.allRedirects() addPath: (path)-> @append JST['cmsimple/views/redirects/_path'](path) destroy: (e)-> e.preventDefault() item = $(e.target) id = item.data('id') || $(item.parents('[data-id]')[0]).data('id') CMSimple.Path.destroy(id)
Version data entries
3 entries across 3 versions & 1 rubygems