mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Meta-t adds file finder to bottom of layout.
This commit is contained in:
@@ -16,7 +16,7 @@ class FileFinder extends Template
|
||||
|
||||
populateUrlList: ->
|
||||
@urlList.empty()
|
||||
for url in @findMatches(@input.text())
|
||||
for url in @findMatches(@input.val())
|
||||
@urlList.append $("<li>#{url}</li>")
|
||||
|
||||
findMatches: (query) ->
|
||||
|
||||
@@ -5,12 +5,17 @@ module.exports =
|
||||
class Layout extends Template
|
||||
@attach: ->
|
||||
view = @build()
|
||||
$('body').append(view)
|
||||
$('body').append view
|
||||
view
|
||||
|
||||
content: ->
|
||||
@link rel: 'stylesheet', href: 'static/atom.css'
|
||||
@div id: 'app-horizontal', =>
|
||||
@div id: 'app-vertical', =>
|
||||
@div id: 'main'
|
||||
@div id: 'app-vertical', outlet: 'vertical', =>
|
||||
@div id: 'main', outlet: 'main'
|
||||
|
||||
viewProperties:
|
||||
addPane: (view) ->
|
||||
pane = $('<div class="pane">')
|
||||
pane.append(view)
|
||||
@main.after(pane)
|
||||
|
||||
@@ -4,6 +4,7 @@ $ = require 'jquery'
|
||||
|
||||
Layout = require 'layout'
|
||||
Editor = require 'editor'
|
||||
FileFinder = require 'file-finder'
|
||||
|
||||
# This a weirdo file. We don't create a Window class, we just add stuff to
|
||||
# the DOM window.
|
||||
@@ -31,9 +32,13 @@ windowAdditions =
|
||||
$(window).unbind('blur')
|
||||
$(window).unbind('keydown')
|
||||
|
||||
findFile: ->
|
||||
window.layout.addPane(FileFinder.build(urls: [@editor.buffer.url]))
|
||||
|
||||
bindKeys: ->
|
||||
@bindKey 'meta+s', => @editor.save()
|
||||
@bindKey 'meta+w', => @close()
|
||||
@bindKey 'meta+t', => @findFile()
|
||||
|
||||
bindMenuItems: ->
|
||||
@bindMenuItem "File > Save", "meta+s", => @editor.save()
|
||||
|
||||
@@ -8,6 +8,7 @@ paths = [
|
||||
"#{resourcePath}/src"
|
||||
"#{resourcePath}/extensions"
|
||||
"#{resourcePath}/vendor"
|
||||
"#{resourcePath}/static"
|
||||
]
|
||||
|
||||
window.__filename = null
|
||||
|
||||
Reference in New Issue
Block a user