diff --git a/src/pane.coffee b/src/pane.coffee
index 8359dae62..cc4978f88 100644
--- a/src/pane.coffee
+++ b/src/pane.coffee
@@ -1,4 +1,4 @@
-{bindKey} = require 'keybinder'
+$ = require 'jquery'
module.exports =
class Pane
@@ -9,12 +9,35 @@ class Pane
showing: false
constructor: (@window) ->
+ $('.pane').live 'click', (event) =>
+ console.log @.constructor.name
+ true
+
+ add: ->
+ verticalDiv = $('#app-vertical')
+ horizontalDiv = $('#app-horizontal')
+
+ el = $ "
"
+ el.addClass "pane " + @position
+ el.append @html
+
+ switch @position
+ when 'top', 'main'
+ verticalDiv.prepend el
+ when 'left'
+ horizontalDiv.prepend el
+ when 'bottom'
+ verticalDiv.append el
+ when 'right'
+ horizontalDiv.append el
+ else
+ throw "I DON'T KNOW HOW TO DEAL WITH #{@position}"
toggle: ->
if @showing
@html.parent().detach()
else
- @window.addPane this
+ @add this
@showing = not @showing
diff --git a/src/window.coffee b/src/window.coffee
index 045d06356..33cc1173a 100644
--- a/src/window.coffee
+++ b/src/window.coffee
@@ -55,26 +55,6 @@ class Window
console.warn "Plugin Loading Failed: #{plugin.constructor.name}"
console.warn error
- addPane: ({position, html}) ->
- verticalDiv = $('#app-vertical')
- horizontalDiv = $('#app-horizontal')
-
- el = $ "
"
- el.addClass "pane " + position
- el.append html
-
- switch position
- when 'top', 'main'
- verticalDiv.prepend el
- when 'left'
- horizontalDiv.prepend el
- when 'bottom'
- verticalDiv.append el
- when 'right'
- horizontalDiv.append el
- else
- throw "I DON'T KNOW HOW TO DEAL WITH #{position}"
-
close: ->
@controller.close()