summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-08-13 11:15:55 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2017-08-13 11:16:20 -0600
commit8b07dc5cb8c259e8e51e2e2a81d9f03284b62cf1 (patch)
tree1c690b444b1a20212178cd13def7a456ab0356cc
parent37893493f50285714f3b2a69fdf0c2f6cd318210 (diff)
buildTabbedChartUi(): use `ph` as the iterator for placeholders, rather than `el`
I was really confused; I expect `el` to be a DOM node.
-rw-r--r--jarmon/jarmon.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js
index 7be4f16..5f8d854 100644
--- a/jarmon/jarmon.js
+++ b/jarmon/jarmon.js
@@ -1194,15 +1194,17 @@ jarmon.buildTabbedChartUi = function ($chartTemplate, chartRecipes,
var ti = new jarmon.TabbedInterface($tabTemplate, tabRecipes);
var charts = jQuery.map(
+ // As a reminder, TabbedInterface#placeholders is an array of
+ // `["placeholder-name", jQuery-placeholder]` pairs.
ti.placeholders,
- function(el, i) {
+ function(ph, i) {
var chart = new jarmon.Chart(
- $chartTemplate.clone().appendTo(el[1]),
- chartRecipes[el[0]],
+ $chartTemplate.clone().appendTo(ph[1]),
+ chartRecipes[ph[0]],
serialDownloader
);
- $('input[name=chart_edit]', el[1][0]).live(
+ $('input[name=chart_edit]', ph[1][0]).live(
'click',
{chart: chart},
function(e) {
@@ -1212,7 +1214,7 @@ jarmon.buildTabbedChartUi = function ($chartTemplate, chartRecipes,
}
);
- $('input[name=chart_delete]', el[1][0]).live(
+ $('input[name=chart_delete]', ph[1][0]).live(
'click',
{chart: chart},
function(e) {