Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch参数为false时,预览html出现空白 #10

Closed
kevinma2010 opened this issue Feb 18, 2015 · 7 comments
Closed

watch参数为false时,预览html出现空白 #10

kevinma2010 opened this issue Feb 18, 2015 · 7 comments

Comments

@kevinma2010
Copy link
Contributor

testEditor = editormd("test-editormd", {
  width: "90%",
  height: 540,
  watch: false,
  path : '../lib/'
});

调用testEditor.previewing(); 后出现空白内容. watch参数为true就没问题

@pandao
Copy link
Owner

pandao commented Feb 19, 2015

@lenbo-ma 这应该在你提交的pull request中得到解决了吧?我已经合并你的pull request。

@pandao
Copy link
Owner

pandao commented Feb 19, 2015

目前在editor.md加载完成(onload)之前不能立即调用实例的任何方法,要么在onload配置选项的回调方法内调用。

@kevinma2010
Copy link
Contributor Author

那是否可以在调用previewing函数进行预览时,先检查是否已经将编辑器内的markdown渲染到预览区。我看到previewing函数只是在控制右侧预览区的布局

在 2015年2月19日 下午4:28,pandao notifications@github.com写道:

目前在editor.md加载完成(onload)之前不能立即调用实例的任何方法,要么在onload配置选项的回调方法内调用。


Reply to this email directly or view it on GitHub
#10 (comment).

@pandao
Copy link
Owner

pandao commented Feb 19, 2015

因为Editor.md依赖的模块是动态加载的,所以在onload之前不要立即调用实例对象的成员方法。

@pandao
Copy link
Owner

pandao commented Feb 19, 2015

配置选项要么一步到位,要么在onload选项的回调函数里调用。

@kevinma2010
Copy link
Contributor Author

嗯,我明白是模块是动态加载的. 我是说加入watch参数初始时false。初始化完成后。手动点击页面上的一个按钮触发了previewing函数,
此时markdown并未渲染, 所以出现了空白。不知道是否有全局变量标记markdown是否渲染, 如果有,就可以在这个函数中做一下处理

2015-02-19 16:35 GMT+08:00 pandao notifications@github.com:

配置选项要么一步到位,要么在onload选项的回调函数里调用。


Reply to this email directly or view it on GitHub
#10 (comment).

@pandao
Copy link
Owner

pandao commented Feb 19, 2015

我知道你说的是什么意思了,我这边已经改过来了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants