mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Merge pull request #2941 from laituan245/master
Fixed #2729 (bug in the article preview button)
This commit is contained in:
commit
42b7efab76
1 changed files with 8 additions and 3 deletions
|
@ -54,8 +54,12 @@ module.exports = class ArticleEditView extends RootView
|
|||
return unless @treema and @preview
|
||||
m = marked(@treema.data.body)
|
||||
b = $(@preview.document.body)
|
||||
onLoadHandler = =>
|
||||
if b.find('#insert').length == 1
|
||||
b.find('#insert').html(m)
|
||||
b.find('#title').text(@treema.data.name)
|
||||
clearInterval(id)
|
||||
id = setInterval(onLoadHandler, 100)
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
|
@ -71,6 +75,7 @@ module.exports = class ArticleEditView extends RootView
|
|||
@patchesView.load()
|
||||
|
||||
openPreview: ->
|
||||
if not @preview or @preview.closed
|
||||
@preview = window.open('/editor/article/preview', 'preview', 'height=800,width=600')
|
||||
@preview.focus() if window.focus
|
||||
@preview.onload = => @pushChangesToPreview()
|
||||
|
|
Loading…
Reference in a new issue