       ctx: @mainCtx
       draw: @draw
 
-    @aceElement = document.createElement 'div'
-    @aceElement.className = 'droplet-ace'
-
-    @wrapperElement.appendChild @aceElement
-
-    @aceEditor = ace.edit @aceElement
-
-    @aceEditor.setTheme 'ace/theme/chrome'
-    @aceEditor.setFontSize 15
-    acemode = @options.mode
-    if acemode is 'coffeescript' then acemode = 'coffee'
-    @aceEditor.getSession().setMode 'ace/mode/' + acemode
-    @aceEditor.getSession().setTabSize 2
+    # We can be passed a div
+    if @aceEditor instanceof Node
+      @wrapperElement = @aceEditor
+
+
+      @aceElement = document.createElement 'div'
+      @aceElement.className = 'droplet-ace'
+
+      @wrapperElement.appendChild @aceElement
+
+      @aceEditor = ace.edit @aceElement
+
+      @aceEditor.setTheme 'ace/theme/chrome'
+      @aceEditor.setFontSize 15
+      acemode = @options.mode
+      if acemode is 'coffeescript' then acemode = 'coffee'
+      @aceEditor.getSession().setMode 'ace/mode/' + acemode
+      @aceEditor.getSession().setTabSize 2
+
+    else
+      @wrapperElement = document.createElement 'div'
+      @wrapperElement.className = 'droplet-editor'
+
+      @aceEditor.container.parentElement.appendChild @wrapperElement
+      @wrapperElement.appendChild @aceEditor.container
+
+    # Append populated divs
+    @wrapperElement.appendChild @dropletElement
+    @wrapperElement.appendChild @paletteWrapper
+
+    @wrapperElement.style.backgroundColor = '#FFF'
 
     @currentlyAnimating = false
 

    @paletteWrapper.style.width = '270px'

    @dropletElement.style.left = @paletteWrapper.offsetWidth + 'px'

    @wrapperElement.appendChild @paletteWrapper

    @draw = new draw.Draw()



    # We give our element a tabIndex so that it can be focused and capture keypresses.
    @dropletElement.tabIndex = 0

    # ### Canvases
    # Create the palette and main canvases
