Fixes errant cursor, adds viewport defaults.
authordsc <dsc@less.ly>
Fri, 11 May 2012 21:32:09 +0000 (14:32 -0700)
committerdsc <dsc@less.ly>
Fri, 11 May 2012 21:32:09 +0000 (14:32 -0700)
lib/dashboard/dashboard-view.co
lib/graph/graph-display-view.co
lib/graph/graph-edit-view.co
lib/template/dashboard.jade

index 71e820d..d457696 100644 (file)
@@ -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()
 
 
index 8a720c2..8b535fe 100644 (file)
@@ -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 }
index af0a2bc..f41f033 100644 (file)
@@ -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 }
index b4edcca..f8adfc1 100644 (file)
@@ -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")