Skip to content
Snippets Groups Projects
Commit d0c5ac4a authored by Florent Baldino's avatar Florent Baldino
Browse files

Cache only last response in markdown preview

parent af24645d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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'
Loading
Loading
@@ -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) ->
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment