Getting panes ready for split viewing.

This commit is contained in:
Corey Johnson 2011-11-14 15:01:45 -08:00
parent a83003d7c5
commit 6e1cee2e88
3 changed files with 17 additions and 11 deletions

View File

@ -5,7 +5,7 @@
<body>
<div id='app-horizontal'>
<div id='app-vertical'>
<div id='main-container' class='main pane'></div>
<div id='main'></div>
</div>
</div>
</body>

View File

@ -16,10 +16,8 @@ class Pane
switch @position
when 'main'
# There can be multiple 'main' panes, but only one can be active
# at at time. ICK.
$('#main-container').children().css 'display', 'none !important'
$('#main-container').append @pane
$('#main > div').addClass 'hidden'
$('#main').append @pane
when 'top'
verticalDiv.prepend @pane
when 'left'
@ -32,19 +30,17 @@ class Pane
throw "pane position of #{this} can't be `#{@position}`"
showing: ->
@pane and not @pane.css('display').match /none/
@pane and not @pane.hasClass 'hidden'
show: ->
if @position == 'main'
$('#main-container').children().css 'display', 'none !important'
if not @pane
@add()
else
@pane.css 'display', '-webkit-box !important'
$('#main > div').addClass 'hidden' if @position == 'main'
@pane.removeClass 'hidden'
hide: ->
@pane.css 'display', 'none !important'
@pane.addClass 'hidden'
toggle: ->
if @showing()

View File

@ -22,10 +22,20 @@ body {
-webkit-box-orient: vertical;
}
#main {
display: -webkit-box;
-webkit-box-flex: 1;
-webkit-box-orient: vertical;
}
.main {
-webkit-box-flex: 1;
}
.pane.hidden {
display: none;
}
.pane {
display: -webkit-box;
-webkit-box-orient: vertical;