mirror of
https://github.com/atom/atom.git
synced 2026-02-18 18:34:21 -05:00
atom and stdlib
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
$ = require 'jquery'
|
||||
|
||||
module.exports =
|
||||
class Pane
|
||||
position: null
|
||||
|
||||
html: null
|
||||
|
||||
add: ->
|
||||
verticalDiv = $('#app-vertical')
|
||||
horizontalDiv = $('#app-horizontal')
|
||||
|
||||
@pane = $ "<div>"
|
||||
@pane.addClass "pane " + @position
|
||||
@pane.append @html
|
||||
|
||||
switch @position
|
||||
when 'main'
|
||||
# ICK: There can be multiple 'main' panes, but only one can be active
|
||||
# at at time.
|
||||
$('#main-container').children().css 'display', 'none !important'
|
||||
$('#main-container').append @pane
|
||||
when 'top'
|
||||
verticalDiv.prepend @pane
|
||||
when 'left'
|
||||
horizontalDiv.prepend @pane
|
||||
when 'bottom'
|
||||
verticalDiv.append @pane
|
||||
when 'right'
|
||||
horizontalDiv.append @pane
|
||||
else
|
||||
throw "I DON'T KNOW HOW TO DEAL WITH #{@position}"
|
||||
|
||||
showing: ->
|
||||
@pane and not @pane.css('display').match /none/
|
||||
|
||||
show: ->
|
||||
if @position == 'main'
|
||||
$('#main-container').children().css 'display', 'none !important'
|
||||
|
||||
if not @pane then @add() else @pane.css 'display', '-webkit-box !important'
|
||||
|
||||
hide: ->
|
||||
@pane.css 'display', 'none !important'
|
||||
|
||||
toggle: ->
|
||||
if @showing()
|
||||
@hide()
|
||||
else
|
||||
@show()
|
||||
Reference in New Issue
Block a user