diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-08-13 11:15:55 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-08-13 11:16:20 -0600 |
commit | 8b07dc5cb8c259e8e51e2e2a81d9f03284b62cf1 (patch) | |
tree | 1c690b444b1a20212178cd13def7a456ab0356cc /jarmon/jarmon.js | |
parent | 37893493f50285714f3b2a69fdf0c2f6cd318210 (diff) |
buildTabbedChartUi(): use `ph` as the iterator for placeholders, rather than `el`
I was really confused; I expect `el` to be a DOM node.
Diffstat (limited to 'jarmon/jarmon.js')
-rw-r--r-- | jarmon/jarmon.js | 12 |
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) { |