From: dsc Date: Tue, 15 May 2012 22:02:53 +0000 (-0700) Subject: Merge remote-tracking branch 'origin/master' into develop X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=a976aefc16faf1767461aa85a3e8c4626929570b;p=kraken-ui.git Merge remote-tracking branch 'origin/master' into develop Conflicts: data/datasources/rc/rc_page_requests_mobile_target.csv lib/dashboard/dashboard-view.co --- a976aefc16faf1767461aa85a3e8c4626929570b diff --cc lib/dashboard/dashboard-view.co index d457696,5c90034..6fc4d59 --- a/lib/dashboard/dashboard-view.co +++ b/lib/dashboard/dashboard-view.co @@@ -24,7 -24,7 +24,7 @@@ DashboardView = exports.DashboardView reach pageviews pageviews_mobile -- pageviews_mobile_target ++ pageviews_mobile_target commons articles articles_per_day @@@ -34,45 -34,10 +34,45 @@@ active_editors_target very_active_editors ]> - - # mobile_devices - # mobile_devices_browsers - # mobile_devices_applications - ++ + core_tab : + graph_ids : <[ + unique_visitors + pageviews + pageviews_mobile - pageviews_mobile_target ++ pageviews_mobile_target + new_editors + active_editors + active_editors_target + ]> + name: ".core-graphs-pane" - ++ + other_tab : + graph_ids : <[ + reach + commons + articles + articles_per_day + edits + very_active_editors + ]> + name: ".other-graphs-pane" - ++ + dev_tab : + graph_ids : <[ + mobile_devices + mobile_devices_browsers + mobile_devices_applications + ]> + name: ".dev-graphs-pane" + + events: - # Select the whole permalink URI text when it receives focus. - # 'click a[data-target="#other-graphs"]' : 'tab_shown' ++ # Select the whole permalink URI text when it receives focus. + 'click .graphs.tabbable .nav a' : 'onTabClick' + 'shown .graphs.tabbable .nav a' : 'tab_shown' - # 'click .load-button' : 'load' - ++ # 'click a[data-target="#other-graphs"]' : 'tab_shown' ++ # 'click .load-button' : 'load' ++ subviews : [] graphs : null ready : false @@@ -86,39 -51,39 +86,39 @@@ initialize: -> @model or= new Dashboard BaseView::initialize ... - @graphs.on 'add', @attachGraphs, this + # @graphs.on 'add', @attachGraphs, this + # @graphs.on 'add', @attachGraph, this @load() - + load: -> + @addTab(@core_tab) + @addTab(@other_tab) + @addTab(@dev_tab) - ++ + addTab: (tab) -> - self = this + self = this - Seq(@graph_ids) - .parMap_ (next_phase, id) -> - Seq() - .seq Graph.lookup, id, Seq - .seq (graph) -> - view = new GraphDisplayView {model:graph} - view.on 'ready', @ok - self.graphs.add graph - .seq next_phase.ok - .seq_ (next) ~> - console.log "#this.ready!" - @ready = true - @attachGraphs() - @trigger 'ready', this + Seq(tab.graph_ids) + .parMap (id) -> + Graph.lookup id, this + .parMap (graph) -> + self.graphs.add graph + this null, new GraphDisplayView {model:graph} - .parMap (view) -> - return if view.isAttached ++ .parMap (view) -> ++ return if view.isAttached + graphs_el = self.$el.find tab.name - graphs_el.append view.el ++ graphs_el.append view.el + self.subviews.push view + view.isAttached = true - - tab_shown: (e) -> + - attachGraphs: -> - graphs_el = @$el.find '#graphs' - for id of @graph_ids - break unless graph = @graphs.get id - continue if graph.view.isAttached - graphs_el.append graph.view.el - @subviews.push graph.view - graph.view.isAttached = true - graph.on 'ready', -> - graph.off 'ready', arguments.callee - graph.view.renderChart() - this ++ tab_shown: (e) -> + console.log 'tab_shown!', e + Seq(@subviews) + .parMap (view) -> + # view.resizeViewport() + view.renderChart() -# }}} + onTabClick: (evt) -> + evt.preventDefault() +