Simplified outline code. Fixed click issue in the editor.

- Outline icon does not change any more.
- When outline is hidden, right part of the editor can now be clicked.
- Use HTML template to implement the UI of the outline.

Fixed #1427.

review: @umop