Permalink
Browse files

Table striping should be handled entirely in CSS

Change-Id: I3a3226d97abaf656e6ab05055009ed4448c9bc4f
  • Loading branch information...
1 parent 770caac commit 62837fef8da33336561828a03688a664fb6efabc Mark Chadwick committed Feb 21, 2013
Showing with 2 additions and 16 deletions.
  1. +1 −1 package.json
  2. +0 −4 test/views/list_view_spec.coffee
  3. +1 −3 test/views/view_spec.coffee
  4. +0 −1 views/list_view.coffee
  5. +0 −7 views/view.coffee
View
@@ -1,6 +1,6 @@
{
"name": "quips",
- "version": "0.0.42",
+ "version": "0.0.43",
"dependencies": {
"coffee-script": "1.3.3",
"jqueryify2": "0.0.1",
@@ -150,11 +150,7 @@ describe 'ListView', ->
collection.add id: 'model-4'
view = new TableListView(collection).render()
-
expect(view.$el.find('.row')).to.have.length 4
- expect(view.$el.find('.row.striped')).to.have.length 2
- expect($(view.$el.find('.row')[1])).to.have.class 'striped'
- expect($(view.$el.find('.row')[3])).to.have.class 'striped'
it 'should sort when passed a sort func', ->
@collection.add id: 'd', name: 'Ddd'
@@ -158,6 +158,4 @@ describe 'View', ->
view = new TableView().render()
expect(view.$el.find('.row')).to.have.length 4
- expect(view.$el.find('.row.striped')).to.have.length 2
- expect($(view.$el.find('.row')[1])).to.have.class 'striped'
- expect($(view.$el.find('.row')[3])).to.have.class 'striped'
+ expect(view.$el.find('.row:nth-child(odd)')).to.have.length 2
View
@@ -95,7 +95,6 @@ class ListView extends View
delete @rows[item.id]
render: ->
- @_setupTables()
@populate()
this
View
@@ -77,19 +77,12 @@ class View extends Backbone.View
else
@html @template()
@populate()
- @_setupTables()
@_focusFirst()
this
_focusFirst: ->
_.defer(=> @$el.find('input:text').filter(':visible').first().focus())
- _setupTables: ->
- $.each @$el.find('.table-striped'), (i, table) ->
- $(table).find('.row').each (j, row) ->
- if j % 2 isnt 0
- $(row).addClass('striped')
-
_blockAvailable: ->
$.blockUI?

0 comments on commit 62837fe

Please sign in to comment.