           style       : 'solid green medium'
         clear         :
           title       : 'Clear'
+          style       : 'solid medium'
+          callback    : @bound 'clearAdvancedSearch'
+        cancel        :
+          title       : 'Cancel'
           style       : 'solid light-gray medium'
-          callback    : @bound 'clearAdvancedSearch'
+          callback    : @bound 'switchToSimpleMode'
       callback        : @bound 'doAdvancedSearch'
 
     { status, type, accounts } = @advancedForm.inputs

  switchToAdvancedMode: ->

    @setClass 'advanced-search-mode'


  pistachio: ->

    @emitSearch query


  clearSimpleSearch: (skipEvent) ->

    @lastQuery = null
    @searchInput.setValue ''

    @emitSearch()  unless skipEvent


  emitSearch: (query) -> @emit 'SearchRequested', query
