History

Speed up re-rendering pages from cache

Thibaut committed 11 years ago

Commit dbc628c1 parent a37e9d823 files · +33 −31Browse files

Showing the changes to assets/javascripts/views/content (1 of 23 files). Show all

Unified · Split

assets/javascripts/views/content/entry_page.coffee+4−4
@@ -24,18 +24,18 @@ class app.views.EntryPage extends app.View · 23 unmodified lines
24 @trigger 'loading'24 @trigger 'loading'
25 return25 return
26 26
27 render: (content = '') ->27 render: (content = '', fromCache = false) ->
28 return unless @activated28 return unless @activated
29 @empty()29 @empty()
30 30
31 @subview = new (@subViewClass()) @el, @entry31 @subview = new (@subViewClass()) @el, @entry
32 @subview.render(content)32 @subview.render(content, fromCache)
33 33
34 if app.disabledDocs.findBy 'slug', @entry.doc.slug34 if app.disabledDocs.findBy 'slug', @entry.doc.slug
35 @hiddenView = new app.views.HiddenPage @el, @entry35 @hiddenView = new app.views.HiddenPage @el, @entry
36 36
37 @trigger 'loaded'37 @trigger 'loaded'
38 @delay @addClipboardLinks38 @delay @addClipboardLinks unless fromCache
39 return39 return
40 40
41 CLIPBOARD_LINK = '<a class="_pre-clip" title="Copy to clipboard"></a>'41 CLIPBOARD_LINK = '<a class="_pre-clip" title="Copy to clipboard"></a>'
@@ -122,7 +122,7 @@ class app.views.EntryPage extends app.View · 80 unmodified lines
122 122
123 restore: ->123 restore: ->
124 if @cacheMap[path = @entry.filePath()]124 if @cacheMap[path = @entry.filePath()]
125 @render @cacheMap[path]125 @render @cacheMap[path], true
126 true126 true
127 127
128 onClick: (event) =>128 onClick: (event) =>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t