Instantiate CodeMirror widgets on demand only.

Review Request #4990 — Created Nov. 18, 2013 and submitted

Information

Review Board
master

Reviewers

Instantiate CodeMirror widgets on demand only.

This lightens MarkdownEditor to only instantiate a CodeMirror wiget as
needed. MarkdownEditor will now create it when show() is called, or when
the inlineEditor begins editing. It will then go away when hidden or
when editing is finished. It should reduce the memory footprint a little
bit. Though it's a bit hard to tell what the savings is, it looks like
it may be as much as 8-10MB.

  • Tested opening, saving and canceling editors.

  • Checked the DOM inspector before, during and after, and saw that the
    CodeMirror widgets only existed while the editor was in edit mode.

  • Tested review requests, the review dialog, and comment dialogs.

Description From Last Updated

There's no reason to override render() anymore, is there?

daviddavid
david
  1. 
      
  2. reviewboard/static/rb/js/views/markdownEditorView.js (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    There's no reason to override render() anymore, is there?

  3. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...