Namespace ui
Anything that directly updates the UI.
Defined in: <js/ui.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
ui.realtimeUpdate(cb)
Smartly update the currently loaded view, based on the current game state.
|
<static> |
ui.update(data, cb)
Replaces the displayed view.
|
Method Detail
<static>
ui.realtimeUpdate(cb)
Smartly update the currently loaded view, based on the current game state.
- Parameters:
- {function()=} cb
- Optional callback that will run after the page updates.
<static>
ui.update(data, cb)
Replaces the displayed view.
This updates the content of the page (either #content if data.inLeague is false or #league_content otherwise), sets the title (and appends the league number to it when appropriate), and injects g.lid as lid to the template.
- Parameters:
- {Object} data
- An object with several properties: "title" the title of the page; "vars" the variables to be passed to the handlebars template; "template" the name of the handlebars template; "isLeague" a boolean saying whether this is within a league or not.
- {function()=} cb
- Optional callback