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
2424 @trigger 'loading'
2525 return
2626
27− render: (content = '') ->
27+ render: (content = '', fromCache = false) ->
2828 return unless @activated
2929 @empty()
3030
3131 @subview = new (@subViewClass()) @el, @entry
32− @subview.render(content)
32+ @subview.render(content, fromCache)
3333
3434 if app.disabledDocs.findBy 'slug', @entry.doc.slug
3535 @hiddenView = new app.views.HiddenPage @el, @entry
3636
3737 @trigger 'loaded'
38− @delay @addClipboardLinks
38+ @delay @addClipboardLinks unless fromCache
3939 return
4040
4141 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
122122
123123 restore: ->
124124 if @cacheMap[path = @entry.filePath()]
125− @render @cacheMap[path]
125+ @render @cacheMap[path], true
126126 true
127127
128128 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