Commit d0c5ac4a authored by Florent Baldino's avatar Florent Baldino

Cache only last response in markdown preview

parent af24645d
......@@ -25,7 +25,7 @@ class @MarkdownPreview
renderMarkdown: (text, success) ->
return unless window.markdown_preview_path
return success(@ajaxCache[text]) if @ajaxCache[text]
return success(@ajaxCache.response) if text == @ajaxCache.text
$.ajax
type: 'POST'
......@@ -33,7 +33,7 @@ class @MarkdownPreview
data: { text: text }
dataType: 'json'
success: (response) =>
@ajaxCache[text] = response
@ajaxCache = text: text, response: response
success(response)
hideReferencedUsers: (form) ->
......
......@@ -24,7 +24,11 @@
%td Show this dialog
%tr
%td.shortcut
.key ctrl shift p
- if browser.mac?
.key ctrl ⌘ p
- else
.key ctrl shift p
%td Toggle Markdown preview
%tbody
%tr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment