updating tree-view html to better situate the resizer

This commit is contained in:
Jon Rohan
2013-01-22 14:31:34 -08:00
parent bb43b2e79a
commit 8039b7c7c1
2 changed files with 12 additions and 8 deletions

View File

@@ -27,7 +27,8 @@ class TreeView extends ScrollView
@instance.serialize()
@content: (rootView) ->
@ol class: 'tree-view tool-panel', tabindex: -1, =>
@div class: 'tree-view-wrapper', =>
@ol class: 'tree-view tool-panel', tabindex: -1, outlet: 'treeViewList'
@div class: 'tree-view-resizer', outlet: 'resizer'
@deserialize: (state, rootView) ->
@@ -37,7 +38,6 @@ class TreeView extends ScrollView
treeView.focusAfterAttach = state.hasFocus
treeView.scrollTopAfterAttach = state.scrollTop
treeView.width(state.width)
treeView.resizer.css(left: state.width)
treeView.attach() if state.attached
treeView
@@ -141,7 +141,7 @@ class TreeView extends ScrollView
@root?.remove()
if rootDirectory = @rootView.project.getRootDirectory()
@root = new DirectoryView(directory: rootDirectory, isExpanded: true, project: @rootView.project)
@append(@root)
@treeViewList.append(@root)
else
@root = null

View File

@@ -1,22 +1,26 @@
.tree-view {
.tree-view-wrapper {
position: relative;
height: 100%;
overflow: auto;
cursor: default;
-webkit-user-select: none;
min-width: 100px;
z-index: 2;
}
.tree-view .tree-view-resizer {
.tree-view {
cursor: default;
-webkit-user-select: none;
overflow: auto;
height: 100%;
}
.tree-view-wrapper .tree-view-resizer {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 10px;
background: transparent;
cursor: col-resize;
position: fixed;
z-index: 3;
}