qsp-files-view.coffee 601 B

12345678910111213141516171819202122232425262728
  1. {SelectListView} = require 'atom-space-pen-views'
  2. module.exports =
  3. class QspFilesView extends SelectListView
  4. initialize: (list, callback) ->
  5. super
  6. @callback = callback
  7. @setItems(list)
  8. @storeFocusedElement()
  9. @panel ?= atom.workspace.addModalPanel(item: this)
  10. @panel.show()
  11. @focusFilterEditor()
  12. viewForItem: (item) ->
  13. "<li>#{item.getPath()}</li>"
  14. destroy: ->
  15. @cancel()
  16. confirmed: (item) ->
  17. @cancel()
  18. @callback?(item)
  19. cancelled: ->
  20. @panel.hide()
  21. getFilterKey: ->
  22. 'path'