Skip to content
Commit e2525781 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Optimize initial rendering of inline examples.

Instead of launching the CodeMirror editor right away, only the toolbar
is created and the original highlighted <pre> is kept.  Only after
"preview" or "code" button is pressed will the <pre> be replaced with
CodeMirror editor and inline preview iframe.

This greatly speeds up the loading time of classes that have inline
examples.  This of course only applies to examples that don't start
off in preview mode - these will still slow the page down.

Most of the logic that was previously in InlineExamples controller is
now moved away to the components.  The controller only deals with the
high-level stuff like initializing the components when page loaded.

From look-and-feel side the editor component now has rounded corners
and looks almost like the normal <pre> code block.  When switching
from <pre> to editor, the text stays at the exact same position,
only the syntax highlighting colors change.

Having removed this slowness factor, inline examples are now also
enabled in IE.  The experience in IE is seriously crappy still...
parent 56c9405b
Loading
Loading
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