Add helpers to add widget actions and formalize a Reload action.

Review Request #10795 — Created Nov. 11, 2019 and updated

chipx86
Review Board
release-4.0.x
ea5b1bc...
reviewboard

RB.Admin.WidgetView now has utility functions for adding header/footer
actions, allowing subclasses to focus on the content of the action and
not the DOM structure. This also simplifies templates, meaning that most
widgets won't even need a custom template anymore.

Widgets do provide an optional built-in action for reloading content. If
a subclass sets canReload to true, the action will be added, and a
reloadContent() method will be called when clicked. Implementations of
this can make use of a setReloading() method that controls a spin
animation for the reload action. Some upcoming widgets will take
advantage of this.

Styling improvements have been made to help the actions stand out
better, and to set better sizes of FontAwesome icons used for actions.

Made use of this in the News widdget.

Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...