events:
# Select the whole permalink URI text when it receives focus.
- # 'click a[data-target="#other-graphs"]' : 'tab_shown'
- 'shown a' : 'tab_shown'
+ # 'click a[data-target="#other-graphs"]' : 'tab_shown'
+ 'click .graphs.tabbable .nav a' : 'onTabClick'
+ 'shown .graphs.tabbable .nav a' : 'tab_shown'
# 'click .load-button' : 'load'
subviews : []
view.isAttached = true
tab_shown: (e) ->
- # console.log 'tab_shown!', e
+ console.log 'tab_shown!', e
Seq(@subviews)
.parMap (view) ->
+ # view.resizeViewport()
view.renderChart()
+
+ onTabClick: (evt) ->
+ evt.preventDefault()
label = @$el.find '.graph-legend'
if width is 'auto'
- vpWidth = viewport.innerWidth()
- labelW = label.outerWidth()
+ vpWidth = viewport.innerWidth() or 300
+ labelW = label.outerWidth() or 228
width = vpWidth - labelW - 10 - (vpWidth - label.position().left - labelW)
width ?= modelW
if height is 'auto'
- height = viewport.innerHeight()
+ height = viewport.innerHeight() or 320
height ?= modelH
size = { width, height }
label = @$el.find '.graph-label'
if width is 'auto'
- vpWidth = @viewport.innerWidth()
- labelW = label.outerWidth()
+ vpWidth = @viewport.innerWidth() or 300
+ labelW = label.outerWidth() or 228
width = vpWidth - labelW - 10 - (vpWidth - label.position().left - labelW)
width ?= modelW
if height is 'auto'
- height = @viewport.innerHeight()
+ height = @viewport.innerHeight() or 320
height ?= modelH
size = { width, height }
section#graph-list
.page-header
- h1 Wikimedia Report Card
+ h1 Wikimedia Report Card
small March 2012
.row
- .graphs.tabbable
- nav
+ .graphs.tabbable
+ nav
ul.nav.subnav.nav-pills
- li: h3 Graphs
- li.active: a(data-target="#core-graphs",data-toggle="tab") Core
- li: a(data-target="#other-graphs",data-toggle="tab") Others
+ li: h3 Graphs
+ li.active: a(href="#core-graphs", data-toggle="tab") Core
+ li: a(href="#other-graphs", data-toggle="tab") Others
if ENV == 'dev'
- li: a(data-target="#dev-graphs",data-toggle="tab") Dev
-
+ li: a(href="#dev-graphs", data-toggle="tab") Dev
+
.tab-content
.core-graphs-pane.tab-pane.active(id="core-graphs")
.other-graphs-pane.tab-pane(id="other-graphs")