Unified · Split
| @@ -27,20 +27,22 @@ class app.views.EntryPage extends app.View · 26 unmodified lines | |||
| 27 | render: (content = '', fromCache = false) -> | 27 | render: (content = '', fromCache = false) -> |
| 28 | return unless @activated | 28 | return unless @activated |
| 29 | @empty() | 29 | @empty() |
| 30 | |||
| 31 | @subview = new (@subViewClass()) @el, @entry | 30 | @subview = new (@subViewClass()) @el, @entry |
| 32 | @subview.render(content, fromCache) | 31 | |
| 32 | $.batchUpdate @el, => | ||
| 33 | @subview.render(content, fromCache) | ||
| 34 | @addClipboardLinks() unless fromCache | ||
| 35 | return | ||
| 33 | 36 | ||
| 34 | if app.disabledDocs.findBy 'slug', @entry.doc.slug | 37 | if app.disabledDocs.findBy 'slug', @entry.doc.slug |
| 35 | @hiddenView = new app.views.HiddenPage @el, @entry | 38 | @hiddenView = new app.views.HiddenPage @el, @entry |
| 36 | 39 | ||
| 37 | @trigger 'loaded' | 40 | @trigger 'loaded' |
| 38 | @delay @addClipboardLinks unless fromCache | ||
| 39 | return | 41 | return |
| 40 | 42 | ||
| 41 | CLIPBOARD_LINK = '<a class="_pre-clip" title="Copy to clipboard"></a>' | 43 | CLIPBOARD_LINK = '<a class="_pre-clip" title="Copy to clipboard"></a>' |
| 42 | 44 | ||
| 43 | addClipboardLinks: => | 45 | addClipboardLinks: -> |
| 44 | for el in @findAllByTag('pre') | 46 | for el in @findAllByTag('pre') |
| 45 | el.insertAdjacentHTML('afterbegin', CLIPBOARD_LINK) | 47 | el.insertAdjacentHTML('afterbegin', CLIPBOARD_LINK) |
| 46 | return | 48 | return |