   constructor:(options, data)->
     memberData = data
     super options, null
-        
+
     @windowController = @getSingleton 'windowController'
     @setListeners()
 

    super
    @setTemplate @pistachio()
    @template.update()
    
  pistachio:-> ''

  setListeners:->
    @on 'ReceivedClickElsewhere', =>
      @unsetClass 'active'
      @resetInputValue()
        
  resetInputValue:-> no

class PersonalFormNameView extends AbstractPersonalFormView

  constructor:(options, data)->
    
    options = $.extend
      cssClass    : 'profilename-form'
      callback    : @formCallback

      callback:(pubInst, events)->
        newWidth = if pubInst.getValue().length < 3 then 3 else if pubInst.getValue().length > 12 then 12 else pubInst.getValue().length
        pubInst.setDomAttributes {size: newWidth}

    @listenTo
      KDEventTypes        : 'keyup'
      listenedToInstance  : @lastName
      callback:(pubInst, events)->
        newWidth = if pubInst.getValue().length < 3 then 3 else if pubInst.getValue().length > 12 then 12 else pubInst.getValue().length
        pubInst.setDomAttributes {size: newWidth}

  formCallback:(formData)->
    {profile} = @memberData
    {firstName, lastName} = formData
    if profile.firstName is firstName and profile.lastName is lastName
      @unsetClass 'active'
      return no

    query = $set:
      'profile.firstName' : firstName
      'profile.lastName'  : lastName
