diff options
author | Florent Baldino <fbaldino@onisep.fr> | 2016-03-09 11:30:50 +0300 |
---|---|---|
committer | Florent Baldino <fbaldino@onisep.fr> | 2016-03-09 11:30:50 +0300 |
commit | d0c5ac4ae3a5900e2619727b47114ace31a6c7ff (patch) | |
tree | d6ee12b0160f8595c96b1a5f5517b1b89a654d8d /app/assets/javascripts/markdown_preview.js.coffee | |
parent | af24645d5d25642f462dea5bacd81908b852c493 (diff) |
Cache only last response in markdown preview
Diffstat (limited to 'app/assets/javascripts/markdown_preview.js.coffee')
-rw-r--r-- | app/assets/javascripts/markdown_preview.js.coffee | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/markdown_preview.js.coffee b/app/assets/javascripts/markdown_preview.js.coffee index 3aa61de2f5a..2a0b9479445 100644 --- a/app/assets/javascripts/markdown_preview.js.coffee +++ b/app/assets/javascripts/markdown_preview.js.coffee @@ -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) -> |