Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MarkItUp! continuous preview refresh without hitting enter

I'm using MarkItUp (http://markitup.jaysalvat.com/) and can't really figure out how to get it to continuously update the preview pane as each character is typed (or even when a 'space' is encountered). By default it refreshes the preview pane only when the enter key is hit.

Is there any way to customize this behavior? The documentation mentions a previewAutoRefresh key, but setting it results in the update-on-enter thing, not any faster.

Thanks!

like image 666
psychotik Avatar asked Sep 03 '09 05:09

psychotik


1 Answers

Use the same technique as in this question.

$(".mymarkitupclass").keyup(function(){
    $('a[title="Preview"]').trigger('mousedown');
});

Note that this will send a new request to your webserver on every keypress, so if you have a lot of users, this'll be a lot of hits.

like image 111
beerbajay Avatar answered Oct 03 '22 02:10

beerbajay