Add utility functions for binding TextEditorViews to elements/models.

Review Request #6477 — Created Oct. 21, 2014 and submitted

Information

Review Board
release-2.0.x
b6e687a...

Reviewers

TextEditorView now has a set of utility functions for binding various
things in a consistent way.

bindRichTextAttr() will cause the TextEditorView's richText flag to
be initially set and bound to an attribute on a model. It will not save
out to that attribute, as in practice that's not very useful to us (we
tend to pull data out of the editor when we go to save).

Passing bindRichText: {model: ..., attrName: ...} to the constructor
will initiate a bindRichTextAttr() automatically.

bindRichTextCheckbox() will bind the richText flag to a checkbox,
synchronizing state both ways. This is used internally for the
inlineEditor, but will also be used in other locations.

bindRichTextVisibility() will bind the richText flag to the
visibility of an element. This is also used internally for the Markdown
Reference link, and will be used elsewhere.

Unit tests have been added to cover these cases.

Unit tests pass.

Tested manually with different settings, along with some upcoming changes.

reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/ui/views/tests/textEditorViewTests.js
        reviewboard/static/rb/js/ui/views/textEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/ui/views/tests/textEditorViewTests.js
        reviewboard/static/rb/js/ui/views/textEditorView.js
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to markdown-redesign (13f2dbf)
Loading...