     if nextProps.params.subjectSetID isnt @props.params.subjectSetID
       @setSubjectSet(nextProps.params.subjectSetID)
 
-
   componentWillMount: ->
     @setSubjectSet(@props.params.subjectSetID)
-
 
   setSubjectSet: (subjectSetId) ->
     subject_set = apiClient.type('subject_sets').get subjectSetId

React = require 'react'
AutoSave = require '../../components/auto-save'
handleInputChange = require '../../lib/handle-input-change'
PromiseRenderer = require '../../components/promise-renderer'
apiClient = require 'panoptes-client/lib/api-client'
ChangeListener = require '../../components/change-listener'
Papa = require 'papaparse'

        @setState pageCount: newPageCount

    gettingSubjects = gettingSetMemberSubjects.get 'subject'
    gettingSubjects.then( (subjects) =>
      @setState 
        subjects: subjects
        page: page
    ).catch( (error) =>
      console.log error
    )

  newPage: (e) ->
    pageValue = e.target.value
    @setSubjectResources @props.subjectSet.id, pageValue

  render: ->
    if @state.subjects
      <div>
        <SubjectSetListingTable subjects={@state.subjects} onPreview={@previewSubject} onRemove={@removeSubject} />
        <nav className="pagination">
          Page <select value={@state.page} disabled={@state.pageCount < 2 or isNaN @state.pageCount} onChange={(e) => @newPage(e)}>
            {if isNaN @state.pageCount
              <option>?</option>
            else
              for p in [1..@state.pageCount]
                <option key={p} value={p}>{p}</option>}
          </select> of {@state.pageCount || '?'}
        </nav>
      </div>
    else
      null

  previewSubject: (subject) ->
    alert <div className="content-container subject-preview">
