From 8fd4ddd543baeedd351270555c56049b6f1d824f Mon Sep 17 00:00:00 2001 From: dsc Date: Fri, 11 May 2012 14:32:09 -0700 Subject: [PATCH] Fixes errant cursor, adds viewport defaults. --- lib/dashboard/dashboard-view.co | 11 ++++++++--- lib/graph/graph-display-view.co | 6 +++--- lib/graph/graph-edit-view.co | 6 +++--- lib/template/dashboard.jade | 16 ++++++++-------- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/dashboard/dashboard-view.co b/lib/dashboard/dashboard-view.co index 71e820d..d457696 100644 --- a/lib/dashboard/dashboard-view.co +++ b/lib/dashboard/dashboard-view.co @@ -68,8 +68,9 @@ DashboardView = exports.DashboardView = BaseView.extend do # {{{ 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 : [] @@ -111,9 +112,13 @@ DashboardView = exports.DashboardView = BaseView.extend do # {{{ 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() diff --git a/lib/graph/graph-display-view.co b/lib/graph/graph-display-view.co index 8a720c2..8b535fe 100644 --- a/lib/graph/graph-display-view.co +++ b/lib/graph/graph-display-view.co @@ -127,12 +127,12 @@ GraphDisplayView = exports.GraphDisplayView = BaseView.extend do # {{{ 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 } diff --git a/lib/graph/graph-edit-view.co b/lib/graph/graph-edit-view.co index af0a2bc..f41f033 100644 --- a/lib/graph/graph-edit-view.co +++ b/lib/graph/graph-edit-view.co @@ -168,12 +168,12 @@ GraphEditView = exports.GraphEditView = BaseView.extend do # {{{ 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 } diff --git a/lib/template/dashboard.jade b/lib/template/dashboard.jade index b4edcca..f8adfc1 100644 --- a/lib/template/dashboard.jade +++ b/lib/template/dashboard.jade @@ -1,18 +1,18 @@ 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") -- 1.7.0.4