summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-08-13 23:19:37 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2017-08-13 23:19:37 -0600
commita5bbe95bbc97ce673e51c7025ae2452c35af2450 (patch)
treed8a87ecf1ffd1730c8d4eeb15fb5e829c4f7a601
parentc596af8874c87df1d7f30feebbd02dd9ef0c4789 (diff)
docs: buildTabbedChartUi(): Document the extra features of the chart tmpl
-rw-r--r--jarmon/jarmon.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js
index d941a8f..2a87b55 100644
--- a/jarmon/jarmon.js
+++ b/jarmon/jarmon.js
@@ -1176,13 +1176,25 @@ jarmon.TabbedInterface.prototype.setup = function() {
/**
* Setup chart date range controls and all charts
*
+ * For each chart, a clone of the $chartTemplate are inserted into the document,
+ * and these inserted copies are passed to `new {@link jarmon.Chart}()`.
+ * Therefore, the $chartTemplate should have elements matching the same
+ * selectors documented there. However, in addition to those, it is useful to
+ * have elements matching these selectors:
+ *
+ * - `input[name=chart_edit]` (optional) : A button to be clicked. If present,
+ * when clicked, the graph-legend will turn in to a {@link
+ * jarmon.ChartEditor}, allowing the user to edit the chart's recipe.
+ * - `input[name=chart_delete]` (optional) : A button to be clicked. If
+ * present, when clicked, the graph will be removed from the UI.
+ *
* @todo Figure out how to allow `$chartTemplate` to be an HTML5 <template>
* element.
*
* @method
* @requires jQuery
*
- * @param $chartTemplate {module:jQuery.jQuery} See {@link jarmon.Chart}
+ * @param $chartTemplate {module:jQuery.jQuery} See {@link jarmon.Chart}, see above
* @param chartRecipes {Object.<string, recipe>} A map of
* placeholder-names (see {@link jarmon.TabbedInterface})
* to chart recipes (see {@link jarmon.Chart})