Commit 265879ed authored by Matt Vanderpol's avatar Matt Vanderpol

Initial support to duplicate a tool row

parent 09131096
......@@ -13,6 +13,20 @@ var CategoryRoiCalculator = {
$(document).on('click', '.js-competitor-dropdown li', this.handleDropdownClick.bind(this));
this.updateTotal();
this.setDefaultCompetitors();
this.setupAddToolSupport();
},
setupAddToolSupport: function() {
$('.js-competitor-dropdown').append('<span class="add-tool js-roi-calculator-add-tool">+</span>');
$(document).on('click', '.js-roi-calculator-add-tool', this.handleAddToolClick.bind(this));
},
handleAddToolClick: function(event) {
this.addToolRow($(event.currentTarget));
},
addToolRow: function($$) {
var $row = $$.parents('.data-row:first');
var $newRow = $row.clone();
$newRow.find('.data-col').filter(':not(:last-child)').html('');
$row.after($newRow);
},
setDefaultCompetitors: function() {
var self = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment