Skip to content

Commit

Permalink
remove specific dom el dependency from the lib
Browse files Browse the repository at this point in the history
  • Loading branch information
djeremh committed Sep 29, 2014
1 parent 392ae65 commit 4acf1b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions client_src/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ $(document).ready () =>
window.dom2shareInstance = new DOM2Share doc, container, () ->
event = new CustomEvent "loaded", { "detail": "The share.js document has finished loading" }
document.dispatchEvent event
$(container).children()[0].id = "wysiwyg-editor"
editor = new MediumEditor(document.getElementById("wysiwyg-editor"), {
'buttons': ['bold', 'italic', 'underline', 'superscript', 'subscript', 'anchor', 'image', 'header1', 'header2', 'quote', 'orderedlist', 'unorderedlist', 'pre', 'indent', 'outdent']
})
4 changes: 2 additions & 2 deletions client_src/dom2share.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class root.DOM2Share
return
if @targetDOMElement.parentNode? #Its not the document root
if not @doc.getSnapshot()
body = ["div", {"id": "wysiwyg-editor"}]
body = ["div", {}]
@doc.submitOp([{"p":[], "oi":body}])
else #Its the document root
if not @doc.getSnapshot()
body = ["div", {"id": "wysiwyg-editor"}]
body = ["div", {}]
@doc.submitOp([{"p":[], "oi":body}])
@loadDocIntoDOM()
callback @doc, @rootDiv
Expand Down

0 comments on commit 4acf1b2

Please sign in to comment.