X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=editor.coffee;h=370f2a1d457c42efdc233f7a7bf525da5c008d43;hb=ff17526a0c6a8c8e962a81f8e8b6a3f44053fef1;hp=440bb3e07c01000278511a9b387e1b8395bf49fd;hpb=0d372f534ac3b5439d9db3ad5cfe83d9ad6801e1;p=peach-html5-editor.git diff --git a/editor.coffee b/editor.coffee index 440bb3e..370f2a1 100644 --- a/editor.coffee +++ b/editor.coffee @@ -564,6 +564,7 @@ class PeachHTML5Editor if @options.editor_id? @outer_iframe.setAttribute 'id', @options.editor_id @outer_iframe.onload = => + console.log 'outer onload' @outer_idoc = @outer_iframe.contentDocument icss = domify @outer_idoc, style: children: [ domify @outer_idoc, text: css @@ -572,6 +573,7 @@ class PeachHTML5Editor @iframe = domify @outer_idoc, iframe: {} @iframe.onload = => @init() + setTimeout (=> @init()), 200 # firefox never fires this onload @outer_idoc.body.appendChild( domify @outer_idoc, div: id: 'wrap1', children: [ domify @outer_idoc, div: id: 'wrap2', children: [ @@ -593,7 +595,8 @@ class PeachHTML5Editor @outer_iframe.setAttribute 'style', outer_iframe_style css = outer_css w: outer_bounds.w, h: outer_bounds.h outer_wrap.appendChild @outer_iframe - init: -> # called by @iframe's onload + init: -> # called by @iframe's onload (or timeout on firefox) + return if @initialized # ignore timeout for non-broken browsers @idoc = @iframe.contentDocument @overlay.onclick = (e) => return @onclick e