Skip to content

Commit 0b69b4e

Browse files
committed
Merge pull request cnodejs#76 from leizongmin/master
修复回复框输入慢问题
2 parents 2d692d2 + 1405836 commit 0b69b4e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

views/reply/reply.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<div class='sep10'></div>
3737
<ul class='nav nav-pills'>
3838
<li class='active'><a href='#markdown-<%= indexInCollection+1 %>' data-toggle='pill'>markdown</a></li>
39-
<li><a href='#preview-<%= indexInCollection+1 %>' data-toggle='pill'>预览</a></li>
39+
<li><a href='#preview-<%= indexInCollection+1 %>' data-toggle='pill' onclick="prettyPrint()">预览</a></li>
4040
</ul>
4141
<div class='tab-content'>
4242
<div class='active tab-pane' id='markdown-<%= indexInCollection+1 %>'>

views/topic/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ <h3><% if(topic.top){%>[置顶]<% } %><%= topic.title %></h3>
118118
<div class='tabbable'>
119119
<ul class='nav nav-pills'>
120120
<li class='active'><a href='#markdown' data-toggle='pill'>markdown</a></li>
121-
<li><a href='#preview' data-toggle='pill'>预览</a></li>
121+
<li><a href='#preview' data-toggle='pill' onclick="prettyPrint()">预览</a></li>
122122
</ul>
123123
<div class='tab-content'>
124124
<div class='tab-pane active' id='markdown'>
@@ -155,18 +155,21 @@ <h3><% if(topic.top){%>[置顶]<% } %><%= topic.title %></h3>
155155
var converter = new Showdown.converter();
156156
var editor = new Markdown.Editor(converter);
157157
editor.run();
158+
/*
158159
editor.hooks.chain('onPreviewRefresh', function () {
159160
prettyPrint();
160161
});
161-
162+
*/
162163
$('.reply2_editor').each(function() {
163164
var editor_id = $(this).attr('id');
164165
var suffix = editor_id.slice(editor_id.indexOf('-'));
165166
var editor = new Markdown.Editor(converter, suffix);
166167
editor.run();
168+
/*
167169
editor.hooks.chain('onPreviewRefresh', function () {
168170
prettyPrint();
169171
});
172+
*/
170173
});
171174
}
172175
run_md_editor();

0 commit comments

Comments
 (0)