Fix bug where file-finder pushed editor up.

For now, I'm removing the flexbox treatment of #app-vertical because the file finder just needs to overlay the bottom and absolute positioning is simpler. I'm also using requireStylesheet to load the file finders CSS instead of a link tag.
This commit is contained in:
Nathan Sobo
2012-03-14 18:28:23 -06:00
parent 5bf9925d0a
commit 601cf41108
5 changed files with 14 additions and 35 deletions

View File

@@ -1,6 +1,5 @@
<html>
<head>
<link rel="stylesheet" type="text/css" src="static/reset.css">
<script src='src/stdlib/require.js'></script>
<script>

View File

@@ -6,7 +6,6 @@ module.exports =
class FileFinder extends View
@content: ->
@div class: 'file-finder', =>
@link rel: 'stylesheet', href: "#{require.resolve('file-finder.css')}?#{(new Date).getTime()}"
@ol outlet: 'urlList'
@input outlet: 'input', input: 'populateUrlList'
@@ -14,8 +13,8 @@ class FileFinder extends View
maxResults: null
initialize: ({@urls, @selected}) ->
requireStylesheet 'file-finder.css'
@maxResults = 10
@populateUrlList()
window.keymap.bindKeys ".file-finder",
'up': 'move-up'

View File

@@ -12,10 +12,9 @@ VimMode = require 'vim-mode'
module.exports =
class RootView extends View
@content: ->
@div id: 'app-horizontal', =>
@div id: 'app-horizontal', outlet: 'horizontal', =>
@div id: 'app-vertical', outlet: 'vertical', =>
@div id: 'main', outlet: 'main', =>
@subview 'editor', new Editor
@subview 'editor', new Editor
initialize: ({url}) ->
@editor.keyEventHandler = window.keymap
@@ -41,9 +40,7 @@ class RootView extends View
@editor.setBuffer(@project.open(url)) if fs.isFile(url)
addPane: (view) ->
pane = $('<div class="pane">')
pane.append(view)
@main.after(pane)
@vertical.append(view)
toggleFileFinder: ->
return unless @project

View File

@@ -9,29 +9,14 @@ body {
}
#app-horizontal {
background-image: url(static/images/linen.png);
display: -webkit-box;
min-height: 100%;
-webkit-box-orient: horizontal;
display: -webkit-flexbox;
-webkit-flex-flow: row;
background-image: url(static/images/linen.png);
}
#app-vertical {
display: -webkit-box;
-webkit-box-flex: 1;
-webkit-box-orient: vertical;
background-color: red;
}
#main {
position: relative;
display: -webkit-box;
-webkit-box-flex: 1;
-webkit-box-orient: vertical;
background-color: yellow;
}
.pane {
display: -webkit-box;
background-color: blue;
min-height: 100%;
width: -webkit-flex(1);
}

View File

@@ -1,14 +1,13 @@
.file-finder {
display: -webkit-box;
-webkit-box-orient: vertical;
#app-vertical > .file-finder {
position: absolute;
width: 100%;
bottom: 0;
background-color: #444;
color: #eee;
width: 100%;
max-height: 200px;
-webkit-box-shadow: 0 0 5px 5px #222;
}
.file-finder ol {
-webkit-box-flex: 1;
overflow: hidden;
}