Sha256: 42ed8667649138e33b34b92a95bf43f39aba95ddcb4839a1a02ea8cd43c89a8c
Contents?: true
Size: 513 Bytes
Versions: 35
Compression:
Stored size: 513 Bytes
Contents
AppRouter = Backbone.Router.extend { initialize: (@pageInfos, @widgetList) -> routes: { 'pages/:id': 'getPage' 'custom': 'custom' '*actions': 'defaultRoute' } getPage: (ids) -> id = parseInt(ids) @pageInfos.selectPage(id) @widgetList.fetch() custom: -> @pageInfos.selectNone() dynamicWidget = new DynamicWidgetView {pageInfos: @pageInfos} dynamicWidget.render($('#widgets')) defaultRoute: (actions) -> if @pageInfos.length > 0 @navigate('//pages/1') else @navigate('//custom') }
Version data entries
35 entries across 35 versions & 3 rubygems